adaptive-softmax-pytorch icon indicating copy to clipboard operation
adaptive-softmax-pytorch copied to clipboard

Seems failed to override forward()

Open songyuzhou324 opened this issue 7 years ago • 2 comments

I got error as follows:

File "text8.py", line 121, in train() File "text8.py", line 78, in train loss = criterion(output, Y_var) File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in call result = self.forward(*input, **kwargs) File "/AdaptiveSoftmaxPyTorch/adasoft.py", line 114, in forward output += self.criterion(input[i], Variable(target[i])) File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 357, in call result = self.forward(*input, **kwargs) File "/opt/conda/envs/pytorch-py3.6/lib/python3.6/site-packages/torch/nn/modules/module.py", line 71, in forward raise NotImplementedError NotImplementedError

Any idea?

songyuzhou324 avatar Jan 24 '18 19:01 songyuzhou324

0it [00:00, ?it/s]Traceback (most recent call last): File "text8.py", line 121, in train() File "text8.py", line 75, in train hidden = repackage_hidden(hidden) raise TypeError('iteration over a 0-d tensor') TypeError: iteration over a 0-d tensor

as runing text8.py, the debug information above is present.

xiangzhumeng16 avatar Apr 25 '19 10:04 xiangzhumeng16

Updated to newer version of PyTorch. (2f02ca68d34f83867bea385c4be23a5392823f1e) This will resolved the issue.

rosinality avatar May 04 '19 01:05 rosinality