RuntimeError: Found dtype Long but expected Float
说明此时需要float型数据,但识别到long型数据,此时需要对入参和出参做一下类型转换output=output.to(torch.float32)target=target.to(torch.float32)例证如下:output=net(input)target=variable(t.arange(0,10))#thepointoutput=output.to(torch.float32)t