Survey banner
Switching to Dataiku - a new area to help users who are transitioning from other tools and diving into Dataiku! CHECK IT OUT

Trouble Training new Models in an existing Project

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/", 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/", 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/", 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/", 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/", line 40, in <module>
[18:33:24] [INFO] [dku.utils]  -
[18:33:24] [INFO] [dku.utils]  -   File "/opt/dataiku/python/dataiku/doctor/evaluation/", 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/", 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/", 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/", 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/", line 26, in load_model_from_file
[18:33:24] [INFO] [dku.utils]  -     raise(PickleLoadException(u"Failed to load model from file {}".format(
[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

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,



DSS 12.5.0 has been released which should fix your problem 🙂 

Best regards,

Level 2

Hey there, thanks!

0 Kudos


Labels (4)
A banner prompting to get Dataiku