Hi everyone,
I have built mask r cnn code in https://pytorch.org/tutorials/intermediate/torchvision_tutorial.html. I can train model, and test well. But when I run code:
“example = torch.rand(1, 3, 559, 536)
model.to(‘cpu’)
traced_script_module = torch.jit.trace(model, example)”
I got an error:
"File “C:\Users\ncali\anaconda3\envs\pt_37\lib\site-packages\torchvision\models\detection_utils.py”, line 218, in decode_single pred_ctr_x = dx * widths[:, None] + ctr_x[:, None]
RuntimeError: expected device cpu but got device cuda:0"
I think it is related with “RuntimeError after moving fasterrcnn_resnet50_fpn to CPU from GPU #1738”