Error in move model to cuda

Hello, I have assembled a model from several small models.
I transferred the model to cuda and debugged to make sure it works with cuda,
on the other hand when I run the code I get the following error:
“Input type (torch.cuda.FloatTensor) and weight type (torch.FloatTensor) should be the same”

I would be happy if someone has an ideaת
Thanks,
Aviad

This error is raised, if (some) model parameters are still on the CPU while the input is on the GPU.
If you’ve registered all parameters and buffers as nn.Parameter or self.register_buffer, the model.to('cuda') operation should move them to the GPU.

Thank you,
I’ll try to add that.