New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could not load meta information for optimum pipe #5
Comments
Dear ljollans, sorry for the inconvencience. Model RecreationPlease ask you're colleague to do
Model Usage
Again, sorry for any inconvenience and don't hesitate to write again, so that we can help you solve any issues. |
Hi, I'm running into a similar issue. Apparently, I'm running a newer version. However, re-training is definitely not an option. Is there a possibility to downgrade to a specific version? |
Dear @RDoerfel , |
Thank's a lot. Is there also a way to figure out the version a model was build with? |
Unzip the model file. `import pickle data = pickle.load(open('/path_to_extracted_model/photon_best_model/_optimum_pipe_meta.pkl', 'rb')) print(data)` This should give you the version, e.g. {'photon_version': '2.2.0'} |
Hi @RLeenings, apparently, there is no file named
|
Dear @RDoerfel , |
Thanks a lot @RLeenings, I'll try to use this version as soon as possible and come back if there are any issues. Thank's for the support :) |
I am trying to use a model I was given by a colleague but keep coming up against an error finding base.PhotonBase.
Here is the code I ran:
from photonai.base import Hyperpipe
best_model_file = 'mymodel.photon'
my_model = Hyperpipe.load_optimum_pipe(best_model_file)
where mymodel.photon sits in a folder that also includes a "photon_best_model" folder with __optimum_pipe_0_SimpleImputer.pkl, _optimum_pipe_1_StandardScaler.pkl, _optimum_pipe_2_Ridge.pkl, and optimum_pipe_blueprint.pkl'
I requested these files from my colleague because the errors I was getting indicated they needed to be there to load the model.
Running this I get the following error:
YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details. defaults = yaml.load(f) /Users/lee_jollans/anaconda3/lib/python3.7/site-packages/sklearn/externals/joblib/__init__.py:15: FutureWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+. warnings.warn(msg, category=FutureWarning) Could not load meta information for optimum pipe Traceback (most recent call last): File "tryphoton.py", line 10, in <module> my_model = Hyperpipe.load_optimum_pipe(best_model_file) File "/Users/lee_jollans/anaconda3/lib/python3.7/site-packages/photonai/base/hyperpipe.py", line 1105, in load_optimum_pipe return PhotonModelPersistor.load_optimum_pipe(file, password) File "/Users/lee_jollans/anaconda3/lib/python3.7/site-packages/photonai/base/hyperpipe.py", line 1444, in load_optimum_pipe element_list = PhotonModelPersistor.load_elements(folder=load_folder) File "/Users/lee_jollans/anaconda3/lib/python3.7/site-packages/photonai/base/hyperpipe.py", line 1410, in load_elements loaded_pipeline_element = joblib.load(os.path.join(folder, element_info['filename'] + '.pkl')) File "/Users/lee_jollans/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 605, in load obj = _unpickle(fobj, filename, mmap_mode) File "/Users/lee_jollans/anaconda3/lib/python3.7/site-packages/joblib/numpy_pickle.py", line 529, in _unpickle obj = unpickler.load() File "/Users/lee_jollans/anaconda3/lib/python3.7/pickle.py", line 1085, in load dispatch[key[0]](self) File "/Users/lee_jollans/anaconda3/lib/python3.7/pickle.py", line 1373, in load_global klass = self.find_class(module, name) File "/Users/lee_jollans/anaconda3/lib/python3.7/pickle.py", line 1423, in find_class __import__(module, level=0) ModuleNotFoundError: No module named 'photonai.base.PhotonBase'
My colleague had originally noted that Hyperpipe is imported using
from photonai.base.PhotonBase import Hyperpipe
, which also did not work because I got the PhotonBase error.Note, I am running macOS Mojave and python 3.7.3
Any help is greatly appreciated!
The text was updated successfully, but these errors were encountered: