原文: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