青乌

关注

RuntimeError: expected scalar type Double but found Float

青乌

关注

阅读 72

2022-12-09


网络传入的类型错误,我一开始是expected scalar type Floatbut found long

train_tensor = train_tensor.to(torch.float32)

然后就报

RuntimeError: expected scalar type Double but found Float

然后直接网络哪里修改

RuntimeError: expected scalar type Double but found Float_scala


然后就好了开始训练

RuntimeError: expected scalar type Double but found Float_scala_02


相关推荐

GhostInMatrix

【已解决】Pytorch RuntimeError: expected scalar type Double but found Float

GhostInMatrix 10 0 0

花姐的职场人生

报错解决:RuntimeError: expected scalar type Long but found Float

花姐的职场人生 45 0 0

_鱼与渔_

expected str instance,float found

_鱼与渔_ 68 0 0

思考的鸿毛

RuntimeError: Expected object of device type cuda but got device type cpu for argument ……

思考的鸿毛 83 0 0

九点韶留学

RuntimeError: expected device cuda:0 and dtype Float but got device cuda:0 and dtype Half

九点韶留学 91 0 0

hoohack

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0

hoohack 24 0 0

曾宝月

float 与 double 类型区别

曾宝月 117 0 0

陈情雅雅

C语言:小数(float double)

陈情雅雅 79 0 0

mm_tang

JDK源码(9)-Double、Float

mm_tang 51 0 0

科牛

RuntimeError: Bool type is not supported by dlpack

科牛 103 0 0

精彩评论(0)

0 0 举报