Ben Chuanlong Du's Blog

It is never too late to learn.

Common Issues in PyTorch

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same

This means that the input data and the model are on different devices (CPU and CUDA). Moving them to the same device resolves the issue. Please refer to Move a Tensor to a Specific Device in PyTorch on how to move a Tensor to a specific device.

https://discuss.pytorch.org/t/input-type-torch-floattensor-and-weight-type-torch-cuda-floattensor-should-be-the-same/48633

Error: Expected more than 1 value per channel when training

Comments