当前位置:网站首页>Record the errors encountered in the pytorch training model once

Record the errors encountered in the pytorch training model once

2022-06-21 11:52:00 Wsyoneself

  1. Missing key(s) in state_dict: "first_conv.bias", 
    1. Solve settings :model.load_state_dict(checkpoint,strict=False)
  2.  TypeError: 'Generator' object is not subscriptable
    1. solve : Unify saving and loading ( For example, the model is saved , Just load the whole model and then load_state, If you save a super parameter , Then put it directly into the model , no need load_state 了 )
  3.   Report errors :ValueError: The length of the input vector x must be greater than padlen, which is 18.
    1. solve :y = signal.filtfilt(b, a, x,axis=0) 
  4. Report errors :ValueError: operands could not be broadcast together with shapes (323596,2) (323596,)
    1. reason : Output to view the data in the original warehouse x The dimension of is one-dimensional ( Such as (96161,)), The dimension of the newly added data is two-dimensional ( Such as (321199, 2),(549108, 2))
    2. Error resolution :x_tmp=[token for st in x for token in st] This will turn numpy Turned into list, There is no shape The attribute is
    3. Correct the problem : Yes shape The attributes are array Can be used directly flatten Turn it into 1 Dimensional , If you need to change to another dimension, you can use reshape
  5. 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]
    1. solve : take input To transpose
原网站

版权声明
本文为[Wsyoneself]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/172/202206211143492151.html