【pytorch】【已解决】RuntimeError: Expected object of scalar type Long but got scalar type Int for argument

1 问题描述

期望long类型,但是得到的是Int类型。

2 分析

经过查找,发现是标签出现了问题,在读取标签时,将其转化为long类型。
numpy:array.astype()
torch: tensor.type()

猜你喜欢

转载自blog.csdn.net/YJYS_ZHX/article/details/114375158
今日推荐