cross_entropy_loss(): argument ‘target’ (position 2) must be Tensor, not tuple
于 2024-02-03 11:10:42 首次发布
文章讲述了在使用PyTorch时遇到TypeError:cross_entropy_loss()函数target参数必须是Tensor而非tuple的问题,提供了解决方案,即先使用`.clone().detach()`将目标变量转换为Tensor,并给出了消除警告的建议.


6005

被折叠的 条评论
为什么被折叠?



