李沐,亚马逊AI专家联手打造了动手学习深度学习一书,该书的原版代码是用MXnet框架写的,国内北大有学生翻译成了pytorch版本(太强了),便于学习,但其中因为pytorch的版本更新,有几处的代码编译通过不了
报错记录:来自知乎 逆风的香 的整理
(1)第3节
https://zhuanlan.zhihu.com/p/90590957
错误代码:RuntimeError: Expected object of scalar type Double but got scalar type Float for argument #3 'mat2' in call to _th_addmm_out
加上
X = torch.tensor(X, dtype=torch.float32)
发现。。还是不太行,是pytoch 的版本太新了吗Hhhh,错误代码:
RuntimeError: matrices expected, got 1D, 2D tensors at ..\aten\src\TH/generic/THTensorMath.cpp:36
错误源来自
torch.mm(X, w) + b
意思是,mm()目前只能进行一维点乘运算?
有大佬解答吗