ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 2, 1

every blog every motto: You can do more than you think.

0. 前言

记录

1. 正文

报错:

ValueError: Expected more than 1 value per channel when training, got input size torch.Size([1, 2, 1, 1])

解决办法:
pytorch中,模型训练是BatchNormalization的batch不能为单数,即:

(1,4,30,30)错
(2,4,30,30)对

猜你喜欢

转载自blog.csdn.net/weixin_39190382/article/details/121939695
今日推荐