Hey i tried to save a pretrained model with torch.jit.trace and it says that all tensors are not on the same devices (cuda or cpu). But I don’t understand which tensors, and how can I fix this please ?
Thanks !
---------------------------------------------------------------------------

RuntimeError                              Traceback (most recent call last)

<ipython-input-22-d126d5b7e7f6> in <module>()
      2 
      3 input_tensor = torch.rand(1,3,224,224)
----> 4 script_model = torch.jit.trace(model, input_tensor)
      5 script_model.save("models/fRCNN_resnet50.pt")

14 frames

/usr/local/lib/python3.7/dist-packages/torch/nn/modules/conv.py in _conv_forward(self, input, weight, bias)
    438                             _pair(0), self.dilation, self.groups)
    439         return F.conv2d(input, weight, bias, self.stride,
--> 440                         self.padding, self.dilation, self.groups)
    441 
    442     def forward(self, input: Tensor) -> Tensor:

RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking arugment for argument weight in method wrapper_thnn_conv2d_forward)