JUGGHM/PENet_ICRA2021

Trouble loading .pth.tar: Fix: metrics.py must be in the main directory

sbharadwajj opened this issue · 1 comments

Hi,

Torch have officially removed version 1.3.1 from their website and I am unable to load the pretrained weights using torch versions 1.4 >. I get this error: ModuleNotFoundError: No module named 'metrics', which is then followed by AttributeError: Can't get attribute 'Result' on <module 'metrics' from '/home/lib/python3.8/site-packages/metrics/__init__.py'> after I pip install metrics.

All of these errors arise when I try torch.load('pe.pth.tar').

I searched for some issues and this maybe because PyTorch has changed the way they save and load the models. Would it be possible to save the model using this: _use_new_zipfile_serialization=True as a flag?

Or did you face this error aswell? The latest version of metrics is 0.3.3

Hi, the error was because the file metrics.py was in a different directory.