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

原因:这个原因是因为在使用Crossentropyloss作为损失函数时,output net input 的output应该是 batchsize, n class, height, weight ,而label则是 batchsize, height, weight ,label是单通道灰度图 BCELoss与CrossEntropyLoss都是用于分类问题。BCELoss是CrossEntr ...

2020-04-09 11:39 0 7035 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM