Using IBM Watson I can create and deploy the ML model either using its Auto AI platform or the Jupyter notebook. Once, my model is deployed then how can I download/export the ML model on which the predictions are done i.e. how can I get the final sklearn model (.pkl file), Tensorflow model (.pb file) or the other supported ML models on my local machine?
Asked
Active
Viewed 832 times
1 Answers
1
You can use following WML API call to download the content of your model:-
curl -X PUT 'https://us-south.ml.cloud.ibm.com/ml/v4/models/:model_id/content?content_format=<string>&space_id=<string>&project_id=<string>&pipeline_node_id=<string>&name=<string>&version=2020-09-01' --data-raw '"<object>"'
https://cloud.ibm.com/apidocs/machine-learning#models-download-content
You can also use WML Python Client https://wml-api-pyclient-dev-v4.mybluemix.net/#repository
client.repository.download(model_uid, 'my_model.tar.gz')
Alternatively, if you are using deployment space now, You can simply export the space and just select the model that you would like to export.
In the exported zip file, you will find the model file under the assets/wml_model/
directory.

charles gomes
- 2,145
- 10
- 15
-
Thanks @charles I worked on the above suggestion and it returns 'There is no committed revision for asset with an ID of'. Then I created a revision using WML Python Client for the model and it worked. So, can you tell me why creating a revision is necessary? Is it not done implicitly and How can it be done through the IBM Cloud Pak GUI? – Mahima Jan 06 '21 at 08:38