RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x7 and 784x1024) 报错解决

RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x7 and 784x1024)

运行pytorch时,出现以下报错

RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x7 and 784x1024) 报错解决_第1张图片

错误代码:

RuntimeError: mat1 and mat2 shapes cannot be multiplied (32x7 and 784x1024) 报错解决_第2张图片

出错原因:模型初始化数据报错

解决方案:将784改为7即可

 

你可能感兴趣的:(python,numpy,matplotlib,conda,ipython)