[RuntimeError] Expected floating point type for target with class probabilities, got Long
这个报错类型翻译过来就是:有类别概率的目标的预期浮点类型,得Long大概意思就是你输入的标签值是浮点数,但实际上你所获得的是Long类型的值原代码Train_L=torch.tensor(expect_output,dtype=torch.int64)#int64label=Variable(Train_L)解决方法Train_L=torch.tensor(expect_output,dtype=