- Missing key(s) in state_dict: "first_conv.bias",
- 解决设置:model.load_state_dict(checkpoint,strict=False)
- TypeError: 'Generator' object is not subscriptable
- 解决:将保存和加载统一(比如保存的是模型,就加载整个模型之后再load_state,如果保存的是超参数,则直接放入模型即可,不用load_state了)
- 报错:ValueError: The length of the input vector x must be greater than padlen, which is 18.
- 解决:y = signal.filtfilt(b, a, x,axis=0)
- 报错:ValueError: operands could not be broadcast together with shapes (323596,2) (323596,)
- 原因:输出查看原始仓库中的数据的x的维度是一维的(如(96161,)),而新加入的数据的维度是二维的(如(321199, 2),(549108, 2))
- 错误解决:x_tmp=[token for st in x for token in st] 这样会把numpy变成了list,就没有shape属性了
- 正确解决:有shape属性的都是array可直接使用flatten将其变为1维的,如果需要变成其他维度可以使用reshape
- Expected weight to be a vector of size equal to the number of channels in input, but got weight of shape [512] and input of shape [512, 7622]
- 解决:将input进行转置
记录一次pytorch训练模型遇到的报错
最新推荐文章于 2025-02-27 18:23:57 发布