ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 64, 1, 1])。训练数据的batch_size = 1时,nn.batchnorm2d是无法正常进行归一化的,他需要多个样本的值,来计算均值以及方差。
可以将nn.batchnorm2d ->换成 nn.GroupNorm
ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 64,
最新推荐文章于 2024-06-01 00:28:40 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)