Bootstrap

Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X

建立pycharm工程,运行pytorch中文网上的例子:https://www.pytorchtutorial.com/pytorch-simple-classifier/

出现如下提示:

Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X

【对于softmax的隐式维度选择已经被弃用。更改调用包含dim = X作为参数】

 

错误行数:

pred = F.softmax(self.forward(x))

 

错误分析:pytorch版本不一致引起的问题。

 

改为:

pred = F.softmax(self.forward(x), dim=1)

错误解决。

;