ValueError: Expected more than 1 value per channel when training,got input size…
在 BatchNorm 的forward地方报错
ValueError: Expected more than 1 value per channel when training,got input size...
如果输入是[N,X,1]需要[N,X,1+]
流行解释
:训练中用batch训练的时候当前batch恰好只含一个sample,而由于BatchNorm操作需要多于一个数据计算平均值
普遍解决方法
: dataLoader(drop_last=True)
但是没用,不能改变网络结构,因为在train 的时候没问题
检查看到 test 的时候加载的数据是:
test_seq_input = motion[0, :1, :]
改成
test_seq_input = motion[0, :2, :]
不报这个问题了