@ptrblck @markl  Thank you for your inputs.
I tried a simple example to trace the Maskrcnn detection model using the following script
import torch
import torchvision
model = torchvision.models.detection.maskrcnn_resnet50_fpn(pretrained=True)
model.eval()

test_data = torch.rand(1, 3, 480, 640)
traced_model = torch.jit.trace(model, test_data)


However, I got this error “RuntimeError: The expanded size of the tensor (640) must match the existing size (1066) at non-singleton dimension 2.  Target sizes: [3, 480, 640].  Tensor sizes: [3, 800, 1066]”
Then I changed the input to be of the size [3,800,1056], just to check and got the next error
“RuntimeError: Only tensors or tuples of tensors can be output from traced functions (getNestedOutputTrace at /pytorch/torch/csrc/jit/tracer.cpp:200)”
According to my understanding, the test_data can be any random input (can also be an image of 3 channels) needed to trace and save the model. Could someone please help address this issue?
Torch version: 1.1.0
Torchvision: 0.3.0
python: 3.5
Thank you for the responses.