使用CrossEntropyLoss损失函数时出现 RuntimeError: multi-target not supported at,以及动手计算CrossEntropyLoss
应用CrossEntropyLoss时,注意
Input: (N, C) where C = number of classes
Target: (N)
不要写程序把target独热化。这是我遇到时候的解决办法。
另外可能有用的:https://blog.youkuaiyun.com/ccbrid/article/details/79844005
https://blog.youkuaiyun.com/get...
原创
2019-08-29 02:49:04 ·
3366 阅读 ·
0 评论