当batch里只有一个样本时,再调用batch_norm就会报下面这个错误:
ValueError:Expected more than 1 value per channel when training, got input size torch.Size([1, 512, 1, 1])
在训练前用 num_of_samples % batch_size 计算一下合适的大小
当batch里只有一个样本时,再调用batch_norm就会报下面这个错误:
ValueError:Expected more than 1 value per channel when training, got input size torch.Size([1, 512, 1, 1])
在训练前用 num_of_samples % batch_size 计算一下合适的大小
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。