lmcinnes / pynndescent

A Python nearest neighbor descent for approximate nearest neighbors
BSD 2-Clause "Simplified" License
897 stars 105 forks source link

AttributeError: 'NNDescent' object has no attribute 'parallel_batch_queries' #176

Open chaituValKanO opened 2 years ago

chaituValKanO commented 2 years ago

I am facing above error when i download the model from azureml and convert it back using joblib. Below are the lines

from azureml.core.model import Model umap_model = Model.get_model_path(model_name=UMAP_MODEL_NAME) umap_model = joblib.load(umap_model)

Error Stack:

2022-04-01 09:03:23,178 | root | ERROR | User's init function failed 2022-04-01 09:03:23,181 | root | ERROR | Encountered Exception Traceback (most recent call last): File "/var/azureml-server/aml_blueprint.py", line 217, in register main.init() File "/var/azureml-app/main.py", line 35, in init driver_module.init() File "/structure/azureml-app/code/predict.py", line 184, in init umap_model = joblib.load(umap_model) File "/azureml-envs/azureml_b1cb60a1e5e920a67cefb22f8b19cd0b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 585, in load obj = _unpickle(fobj, filename, mmap_mode) File "/azureml-envs/azureml_b1cb60a1e5e920a67cefb22f8b19cd0b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 504, in _unpickle obj = unpickler.load() File "/azureml-envs/azureml_b1cb60a1e5e920a67cefb22f8b19cd0b/lib/python3.8/pickle.py", line 1212, in load dispatchkey[0] File "/azureml-envs/azureml_b1cb60a1e5e920a67cefb22f8b19cd0b/lib/python3.8/site-packages/joblib/numpy_pickle.py", line 329, in load_build Unpickler.load_build(self) File "/azureml-envs/azureml_b1cb60a1e5e920a67cefb22f8b19cd0b/lib/python3.8/pickle.py", line 1705, in load_build setstate(state) File "/azureml-envs/azuremlb1cb60a1e5e920a67cefb22f8b19cd0b/lib/python3.8/site-packages/pynndescent/pynndescent.py", line 938, in setstate self._init_search_function() File "/azureml-envs/azuremlb1cb60a1e5e920a67cefb22f8b19cd0b/lib/python3.8/site-packages/pynndescent/pynndescent.py", line 1189, in _init_search_function parallel_search = self.parallel_batch_queries AttributeError: 'NNDescent' object has no attribute 'parallel_batch_queries'

Packages used: channels:

lmcinnes commented 2 years ago

I think there is a version mistmatch between what saved the model and what is loading the model. There were some changes in recent versions to allow for, for example, parallel querying.