Input type (torch.cuda.ByteTensor) and weight type (torch.cuda.FloatTensor) should be the same只需要将对应的torch.tensor()改为torch.FloatTensor()就可以了,例如torch.FloatTensor([img])版权声明:本文为qq_34124009原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。原文链接:https://blog.csdn.net/qq_34124009/article/details/107542187