You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading text-search model from winnow/text_search/models/model_best.pth.tar the following error occurs:
Traceback (most recent call last):
File "/home/stepan/work/benetech/programs/anaconda/envs/winnow/lib/python3.6/site-packages/torch/serialization.py", line 608, in load
return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
File "/home/stepan/work/benetech/programs/anaconda/envs/winnow/lib/python3.6/site-packages/torch/serialization.py", line 787, in _legacy_load
result = unpickler.load()
ModuleNotFoundError: No module named 'configs'
Root Cause
The model is saved using pickle with different import paths (e.g. import configs instead of import winnow.text_search.configs). According to the pickle documentation:
pickle can save and restore class instances transparently, however the class definition must be importable and live in the same module as when the object was stored.
The Problem
When loading text-search model from
winnow/text_search/models/model_best.pth.tar
the following error occurs:Root Cause
The model is saved using
pickle
with different import paths (e.g.import configs
instead ofimport winnow.text_search.configs
). According to the pickle documentation:Possible Fix
See the following answer on StackOverflow: https://stackoverflow.com/a/2121918
The text was updated successfully, but these errors were encountered: