1、dimension out of range (expected to be in range of [-1, 0], but got 1)
参考https://github.com/pytorch/pytorch/issues/5554
二分类问题,target.size [batch_size,]
修改,output_class.size() 为[batch_size,2]
2、RuntimeError: multi-target not supported at ...
target.size =[batch_size,1]出错
参考:https://blog.youkuaiyun.com/ccbrid/article/details/79844005
https://blog.youkuaiyun.com/york1996/article/details/81875508
修改,target=target.squeeze()
3、element 0 of tensors does not require grad and does not have a grad_fn
参考:https://blog.youkuaiyun.com/jacke121/article/details/82733197
element 0 of tensors