链接:https://www.cnblogs.com/zmbreathing/p/pyTorch_BN_error.html
在调试网络模型时,设置的x=torch.rand(1,3,352,352),将该tensor送入网络模型,当使用avgpool时,会使得每个channel中只有一个值,会导致batchNormalization(channel)出错,因为只有一个值。
当**把x改为x=torch.rand(2,3,352,352)**问题就解决了。
pytorch报错:ValueError: Expected more than 1 value per channel when training, got input size torch.Siz
最新推荐文章于 2024-02-28 23:10:51 发布