python问题 Traceback (most recent call last)
RuntimeError: scatter(): Expected dtype int64 for index
跑代码时出现报错
RuntimeError: scatter(): Expected dtype int64 for index
true_dist.scatter_(1, target.data.unsqueeze(1), self.confidence)
问题出在scatter的函数参数上:第2个(算上self是第3个)参数应该是tensor,且其包含的元素类型应该是Long型,而
原创
2021-12-22 10:32:19 ·
1904 阅读 ·
1 评论