pytorch RuntimeError: expected scalar type Double but found Float
程序员文章站
2022-07-12 13:51:08
...
RuntimeError: expected scalar type Double but found Float
原因: tensor的数据类型dtype不正确
解决: 将数据类型转为float32
tensor.to(torch.float32)
下一篇: 使用Mybatis进行注册
推荐阅读
-
pytorch RuntimeError: expected scalar type Double but found Float
-
RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target'
-
RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #2 'mat2'
-
RuntimeError: Expected object of scalar type Long but got scalar type Float for argument #2 'target'