青乌

关注

RuntimeError: expected scalar type Double but found Float

青乌

关注

阅读 73

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 11 0 0

花姐的职场人生

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

花姐的职场人生 47 0 0

_鱼与渔_

expected str instance,float found

_鱼与渔_ 69 0 0

思考的鸿毛

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

思考的鸿毛 85 0 0

九点韶留学

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

九点韶留学 92 0 0

hoohack

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

hoohack 30 0 0

曾宝月

float 与 double 类型区别

曾宝月 118 0 0

mm_tang

JDK源码(9)-Double、Float

mm_tang 52 0 0

陈情雅雅

C语言:小数(float double)

陈情雅雅 80 0 0

覃榜言

实型(浮点型):float、double

覃榜言 23 0 0

精彩评论(0)

0 0 举报