Trouble Training new Models in an existing Project

josurriola
Level 2
Trouble Training new Models in an existing Project

Hey there, so I am having trouble training new models on an existing project, if I either update an existing recipe or deploy the newly trained model in a new visual tool in the flow whenever I try to score a dataset,

I am getting the following error: 

Error in python process: <class 'dataiku.base.dku_pickle.PickleLoadException'>: Failed to load model from file /home/dataiku/cache/saved_models/EXPIRED_COUPONS/KsqBonL3/versions/initial/clf.pkl

Does anyone know what this could be or how to fix it? (EXPIRED_COUPONS is the project name)

18:33:24] [INFO] [dku.utils]  - *************** Recipe code failed **************
[18:33:24] [INFO] [dku.utils]  - Begin Python stack
[18:33:24] [INFO] [dku.utils]  - Traceback (most recent call last):
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/utils/load_model.py", line 12, in load_model_from_file
[18:33:24] [INFO] [dku.utils]  -     return dku_pickle.load(clf_file)
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/base/dku_pickle.py", line 51, in load
[18:33:24] [INFO] [dku.utils]  -     return SklearnUnpickler(pkl_file).load()
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/base/dku_pickle.py", line 147, in load
[18:33:24] [INFO] [dku.utils]  -     return super(SklearnUnpickler, self).load()
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/utils/skcompat/_calibrated_classifier.py", line 10, in __setstate__
[18:33:24] [INFO] [dku.utils]  -     self.base_estimator = d['base_estimator']
[18:33:24] [INFO] [dku.utils]  - KeyError: 'base_estimator'
[18:33:24] [INFO] [dku.utils]  - During handling of the above exception, another exception occurred:
[18:33:24] [INFO] [dku.utils]  - Traceback (most recent call last):
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/container/exec_eval_recipe.py", line 40, in <module>
[18:33:24] [INFO] [dku.utils]  -     runner.run()
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/evaluation/base.py", line 134, in run
[18:33:24] [INFO] [dku.utils]  -     self._fetch_input_dataset_and_model_params()
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/evaluation/reg_evaluation_recipe.py", line 84, in _fetch_input_dataset_and_model_params
[18:33:24] [INFO] [dku.utils]  -     self.partition_dispatch, self.partitions = load_model_partitions(self.model_folder_context, self.core_params,
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/prediction/reg_scoring_recipe.py", line 102, in load_model_partitions
[18:33:24] [INFO] [dku.utils]  -     partitions = {"NP": load_model(model_folder_context, core_params, for_eval=for_eval)}
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/prediction/reg_scoring_recipe.py", line 71, in load_model
[18:33:24] [INFO] [dku.utils]  -     clf = load_model_from_file(f)
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/utils/load_model.py", line 26, in load_model_from_file
[18:33:24] [INFO] [dku.utils]  -     raise(PickleLoadException(u"Failed to load model from file {}".format(clf_file.name)))
[18:33:24] [INFO] [dku.utils]  - dataiku.base.dku_pickle.PickleLoadException: Failed to load model from file /home/dataiku/cache/saved_models/EXPIRED_COUPONS/KsqBonL3/versions/initial/clf.pkl

 

0 Kudos
3 Replies
NicolasD
Dataiker

Hello ๐Ÿ™‚ 

If that's a possibility for you, training and deploying using a code environment with scikit-learn >= 1.1 should solve the problem.

Also, this problem should be fixed in the next version of DSS when it's released.

Best regards,
Nicolas

NicolasD
Dataiker

Hello,

DSS 12.5.0 has been released which should fix your problem ๐Ÿ™‚ 

Best regards,
Nicolas

josurriola
Level 2
Author

Hey there, thanks!

0 Kudos