I kept getting the following error:
main_classifier.py:86: UserWarning: Implicit dimension choice for log_softmax has been deprecated. Change the call to include dim=X as an argument.
logpt = F.log_softmax(input)
Then I used dim=1
#logpt = F.log_softmax(input)
logpt = F.log_softmax(input, dim=1)
based on Implicit dimension choice for softmax warning - #10 by ruotianluo
but I get this error
train: True test: False
preparing datasets and dataloaders......
creating models......
=>Epoches 1, learning rate = 0.0010000, previous best = 0.0000
training...
feats shape: torch.Size([64, 419, 512])
labels shape: torch.Size([64])
Traceback (most recent call last):
File "main_classifier.py", line 347, in <module>
loss = criterion(m(output[:,1]-output[:,0]), labels.float())
File "/home/jalal/research/venv/dpcc/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "main_classifier.py", line 87, in forward
logpt = F.log_softmax(input, dim=1)
File "/home/jalal/research/venv/dpcc/lib/python3.8/site-packages/torch/nn/functional.py", line 1769, in log_softmax
ret = input.log_softmax(dim)
IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1)
so how should I find out what dim is?