AttributeError: ‘bool’ object has no attribute ‘sum’ AttributeError: ‘bool’ object has no attribute ‘sum’ 解决方法 将torch.max()改为torch.argmax()查看output和targets的数据类型是否都为tensor 以上就是全部内容,感谢观看!