You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "D:\majority_design\image_caption\ic_train.py", line 322, in
main()
File "D:\majority_design\image_caption\ic_train.py", line 116, in main
train(train_loader=train_loader,
File "D:\majority_design\image_caption\ic_train.py", line 180, in train
loss = criterion(scores, targets)
File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\loss.py", line 1164, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 3014, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
RuntimeError: Expected target size [32, 9490], got [32, 51]
When i debug the code, i found scores's size is (32, 16, 9490), but targets's size is (32, 51)
i am just a rookie of DL, please help me!!! Thank you very much!!!
The text was updated successfully, but these errors were encountered:
Traceback (most recent call last):
File "D:\majority_design\image_caption\ic_train.py", line 322, in
main()
File "D:\majority_design\image_caption\ic_train.py", line 116, in main
train(train_loader=train_loader,
File "D:\majority_design\image_caption\ic_train.py", line 180, in train
loss = criterion(scores, targets)
File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\loss.py", line 1164, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "D:\anaconda3\envs\pytorch\lib\site-packages\torch\nn\functional.py", line 3014, in cross_entropy
return torch._C._nn.cross_entropy_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index, label_smoothing)
RuntimeError: Expected target size [32, 9490], got [32, 51]
When i debug the code, i found scores's size is (32, 16, 9490), but targets's size is (32, 51)
i am just a rookie of DL, please help me!!! Thank you very much!!!
The text was updated successfully, but these errors were encountered: