The error of log_softmax

output = F.log_softmax(self.out(, context), 2)), dim=1)
TypeError: log_softmax() got an unexpected keyword argument 'dim'

The doc is:

input (Variable) – input
dim (int) – A dimension along which log_softmax will be computed.

The error of getting an unexpected keyword argument ‘dim’ is weird.

what is the reason of it?

Please check your Pytorch version. log_softmax() only had one argument in version 0.1.12.

>>> import torch
>>> torch.__version__

It’s not 0.1.12

It seems that this change hasn’t got released.
Please refer to this link:

1 Like

It seems that.Thanks!