Using Models Outside DSS
![ryanraasch](https://us.v-cdn.net/6038231/uploads/Dataiku/nAvatar4.png)
I built/trained/saved a model using DSS and then saved it to my local machine as pickle file. However, when I try to "unpickle" and run the model locally, I get an error saying "ModuleNotFoundError: No module named 'dataiku'". Are there any workarounds to use dataiku models outside of dataiku? I tried 'import dataikuapi as dataiku' before loading the model, but I'm missing the actual dataiku python library. I would like to be able to use the model without having to extract the internal dataiku library that comes with DSS.
Thanks in advance for your help!
Operating system used: Windows
Best Answer
-
gambinoga Dataiker, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Registered Posts: 3 Dataiker
Hello @ryanraasch
,Since Dataiku 11, lab models as well as saved models are now available to be exported in Python fully outside of DSS, see https://doc.dataiku.com/dss/latest/machine-learning/models-export.html#export-to-python
Indeed, you can export the model to a zip file that can then be used to score the model in any Python code.
This scoring uses the "dataiku-scoring" open source Python package, available on pypy.
However, this export is now only available in the Enterprise license.
Thanks !Gregoire
Answers
-
JordanB Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer, Registered Posts: 295 Dataiker
Hi @ryanraasch
,Dataiku APIs are made of two packages, "dataiku-api-client" (module name dataikuapi) and "dataiku-internal-client" (module name dataiku). The latter is not available from pypi repositories and must be downloaded from DSS itself, as indicated here: https://doc.dataiku.com/dss/latest/python-api/outside-usage.html#in-a-requirements-txt-file
Thanks!
Jordan
-
Thank you for your response! I was trying to avoid downloading from DSS if possible.
-
Thank you! I thought I was using an enterprise license but apparently not. This is the sort of thing I am looking for. I appreciate your help.
-
That link is giving a 404. Can you provide a valid link please?
-
Hi Did you manage to get this working? i am also trying to use a saved model from a python endpoint API which also runs outside of DSS.