問題:
UserWarning: Implicit dimension choice for softmax has been deprecated. Change the call to include dim=X as an argument. input = module(input)
這個警告的原因是softmax()函數已經被棄用了,雖然程序還是可以運行成功,但是這個做法不被pytorch所贊成。
這個寫法在早期的pytorch版本是沒有警告的,現在因為其他考慮,要加上有指明dim參數。
nn.Softmax()
改成
nn.Softmax(dim=1)
dim=常為1,可以根據自己的需要更改。