PyTorch - ModuleNotFoundError
I've trained Retinanet for object detection in google colab and now I want to load its .pt file in another python project but I keep getting this error. Any thoughts?
Traceback (most recent call last):
  File &quot;C:\Users\stefan_cepa995\Desktop\breast-mammography-app\app.py&quot;, line 522, in &lt;module&gt;
    model = torch.load(os.path.join(&quot;.&quot;, &quot;models&quot;, &quot;retinanet&quot;, &quot;retinanet_gwd.pt&quot;))
  File &quot;C:\Users\stefan_cepa995\anaconda3\envs\tensorflow\lib\site-packages\torch\serialization.py&quot;, line 594, in load
    return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
  File &quot;C:\Users\stefan_cepa995\anaconda3\envs\tensorflow\lib\site-packages\torch\serialization.py&quot;, line 853, in _load
    result = unpickler.load()
ModuleNotFoundError: No module named 'retinanet'


As @Rika mentioned in comments, solution is to save state_dict and then load it with load_state_dict() function.
