1only batches of spatial targets supported (non-empty 3D tensors) but got targets of size

因为在使用Crossentropyloss作为损失函数时,output=net(input)的output应该是[batchsize, channel, height, weight],而label则是[batchsize, height, weight],label是单通道灰度图,而在BCELoss中,两者都是[batchsize, channel, height, weight]

猜你喜欢

转载自blog.csdn.net/weixin_44025103/article/details/128710059
今日推荐