I am using detecto model which is trained on custom data set, but the problem is when i try to use that model with jit.trace it throws an error.
Code:
from detecto.core import Model
from detecto.utils import read_image
import torch
model = Model.load(model_path, classes)
example = torch.rand(1, 3, 224, 224)
model_trace = torch.jit.trace(model, example)
Error:
Traceback (most recent call last):
File “c:/Users/shehr/Desktop/Android Project/Android_Model.py”, line 21, in 
model_trace = torch.jit.script(model, example)
File “C:\Users\shehr\Anaconda3\envs\tf_gpu\lib\site-packages\torch\jit_init_.py”, line 1257, in script
qualified_name = _qualified_name(obj)
File “C:\Users\shehr\Anaconda3\envs\tf_gpu\lib\site-packages\torch_jit_internal.py”, line 682, in _qualified_name
name = obj.name
AttributeError: ‘Model’ object has no attribute ‘name’
Please help me out