在运行深度学习项目时候,遇到了Expected object of scalar type Long but got scalar type Int for argument #2这种错误,往往就是因为输入类型不匹配导致的问题,可以torch.tensor(label, dtype=torch.long)将类型强制转化为long型
01-20
12-27
1万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-13
5万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)