首页 > 其他分享 >RuntimeError: expected scalar type Double but found Float

RuntimeError: expected scalar type Double but found Float

时间:2022-12-09 10:36:47浏览次数:39  
标签:tensor Double RuntimeError Float scalar expected found type


网络传入的类型错误,我一开始是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


标签:tensor,Double,RuntimeError,Float,scalar,expected,found,type
From: https://blog.51cto.com/u_15796263/5923938

相关文章