对于错误 RuntimeError: expected Double tensor (got Float tensor)
经过实验验证:
这句话有误导, 应该理解成,我希望得到一个float tensor ,但是你给了我一个Double tensor
解决办法:
将模型改成double类型,或者把输入改成 float类型
A fix would be to call .double() on your model (or .float() on the input)
参考链接:
https://discuss.pytorch.org/t/cant-convert-tensor-with-dtype-float64-to-torch-tensor-double/94912