Using a target size (torch.Size([17376, 1])) that is different to the input size (torch.Size([17376]


根据提示,在Lib/site-packages/torch/nn/functional.py文件中在这个系统包中if判断target和input的size前面加了

 target=target.squeeze(-1)
当然有些人的训练模块就能修改target的size,可以参考下面这篇博客的观点
https://blog.csdn.net/weixin_42989041/article/details/111992033
注意,如果修改这个文件你需要选在在当前环境下修改,不要应用到所有环境。