|

楼主 |
发表于 2024-1-9 16:14:13
|
显示全部楼层
这个很有用
File "/home/data/anaconda3/envs/loss/lib/python3.8/site-packages/torch/nn/modules/loss.py", line 961, in forward
return F.cross_entropy(input, target, weight=self.weight,
File "/home/data/anaconda3/envs/loss/lib/python3.8/site-packages/torch/nn/functional.py", line 2468, in cross_entropy
return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
File "/home/data/anaconda3/envs/loss/lib/python3.8/site-packages/torch/nn/functional.py", line 2261, in nll_loss
raise ValueError('Expected input batch_size ({}) to match target batch_size ({}).'
ValueError: Expected input batch_size (128) to match target batch_size (0).
后面又报了这个错误 请问怎么修改 |
|