Dear team,
When executing torch.load("model.pt") I got an error "ModuleNotFoundError: No module named 'wrn'".
Any hints ?
Best,
T.
Here is the full log
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-2-5ca295ae4d4e> in <module>()
----> 1 m1 = torch.load("model.pt")
2 m1
2 frames
/usr/local/lib/python3.7/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
710 opened_file.seek(orig_position)
711 return torch.jit.load(opened_file)
--> 712 return _load(opened_zipfile, map_location, pickle_module, **pickle_load_args)
713 return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
714
/usr/local/lib/python3.7/dist-packages/torch/serialization.py in _load(zip_file, map_location, pickle_module, pickle_file, **pickle_load_args)
1047 unpickler = UnpicklerWrapper(data_file, **pickle_load_args)
1048 unpickler.persistent_load = persistent_load
-> 1049 result = unpickler.load()
1050
1051 torch._utils._validate_loaded_sparse_tensors()
/usr/local/lib/python3.7/dist-packages/torch/serialization.py in find_class(self, mod_name, name)
1040 pass
1041 mod_name = load_module_mapping.get(mod_name, mod_name)
-> 1042 return super().find_class(mod_name, name)
1043
1044 # Load the data (which may in turn use `persistent_load` to load tensors)
ModuleNotFoundError: No module named 'wrn'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
---------------------------------------------------------------------------
Hello,
When loading the Wide ResNets used for CIFAR-10 and CIFAR-100, you need to have wrn.py in a directory that is part of your PATH environment variable. Within Python, this can be done via
"
import sys
sys.path.insert(0, 'path-to-wrn.py-parent-directory')
"
Please see the Jupyter notebook "example_submission.ipynb" for an example of this.
All the best,
Mantas (TDC co-organizer)
great! thanks.
Posted by: tak @ Aug. 2, 2022, 6:07 a.m.