Issue tracing FasterRcnn model

Hi all,
I’m trying to trace fasterrcnn_mobilenet_v3_large_fpn model (fine tuned with custom classes) to be used in an android app
when running the following code:

model = fasterrcnn_mobilenet_v3_large_fpn(pretrained=True)

model.eval()
input_tensor = torch.rand(1,3,224,224)
print(input_tensor)
script_model = torch.jit.trace_module(model,input_tensor)
script_model.save("basic_fasterrcnn_mobilenet3.pt")

I get this problem:

/usr/local/lib/python3.7/dist-packages/torch/jit/_trace.py in trace_module(mod, inputs, optimize, check_trace, check_inputs, check_tolerance, strict, _force_outplace, _module_class, _compilation_unit)
910
911 if not isinstance(inputs, dict):
→ 912 raise AttributeError(“expected a dictionary of (method_name, input) pairs”)
913
914 old_module_map = torch.jit._trace._trace_module_map
AttributeError: expected a dictionary of (method_name, input) pairs

I guesss I’m missing something and not converting the model correctly? could you refer me to how it should be done?