Discover all of the brand-new features and improvements to existing capabilities in the Dataiku 11.3 updateLET'S GO

Issue calling deployed Dataiku model into Python code running in a container

Level 1
Issue calling deployed Dataiku model into Python code running in a container


I'm facing an issue trying to read a Dataiku Visual Model into a Python code which is a part of a webapp  running in a container. I think the model call from dataiku.Model is making the correct call but it's not able to process the get_predictor() command correctly and I'm seeing a file not found error. 

if i am running the webapp using local execution then it seems to work just fine the issue raises only when the webapp runs on a container 


Attaching the log of the error for refrence

File "/opt/dataiku/python/dataiku/core/", line 202, in get_predictor
self._predictors[version_id] = build_predictor_for_saved_model(model_folder, self.get_type(), sm.get("conditionalOutputs", []))
File "/opt/dataiku/python/dataiku/core/", line 268, in build_predictor_for_saved_model
core_params = dkujson.load_from_filepath(osp.join(model_folder, "core_params.json"))
File "/opt/dataiku/python/dataiku/core/", line 36, in load_from_filepath
with open(filepath) as fp:
FileNotFoundError: [Errno 2] No such file or directory: '/app/dataiku/DSS_DATA_DIR/saved_models/<PROJECTKEY>/<modelid>/versions/initial/core_params.json'


0 Kudos
3 Replies

Hello @suhail_shaik 

Thank you for reaching out.

On the attached log, the project key and model ids seem to be missing (look at the `<PROJECTKEY>` and `<modelid>` in the filepath)

The issue must probably lie in the definition of your `filepath`, could you attach the code that performs this operation ?


0 Kudos
Level 1

Hi @MehdiH 

The `<PROJECTKEY>` and `<modelid>` in the file path were deliberately added by me while posting the question here, in the actual error log the path is correct.

The code that i have used is referenced from the below documentation. and you can see that the file path is not manually given.
Interaction with saved models — Dataiku DSS 9.0 documentation

However the above code is running on a containerized execution.

0 Kudos


Unfortunately, it is not currently possible to use these APIs when the webapp is running in a container. You'll need to run this particular webapp locally.

0 Kudos