Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ibm
GitHub Repository: ibm/watson-machine-learning-samples
Path: blob/master/cpd4.5/notebooks/rest_api/curl/experiments/deep_learning/Use Keras to recognize hand-written digits.ipynb
6408 views
Kernel: Python 3 (ipykernel)

Use Keras to recognize hand-written digits with Watson Machine Learning REST API

This notebook contains steps and code to demonstrate support of Keras Deep Learning experiments in Watson Machine Learning Service. It introduces commands for getting data, training experiments, persisting pipelines, publishing models, deploying models and scoring.

Some familiarity with cURL is helpful. This notebook uses cURL examples.

Learning goals

The learning goals of this notebook are:

  • Working with Watson Machine Learning experiments to train Deep Learning models.

  • Downloading computed models to local storage.

  • Online deployment and scoring of trained model.

Contents

This notebook contains the following parts:

  1. Setup

  2. Model definition

  3. Experiment Run

  4. Historical runs

  5. Deploy and Score

  6. Cleaning

  7. Summary and next steps

1. Set up the environment

Before you use the sample code in this notebook, you must perform the following setup tasks:

  • Contact with your Cloud Pack for Data administrator and ask him for your account credentials

Connection to WML

Authenticate the Watson Machine Learning service on IBM Cloud Pack for Data. You need to provide platform url, your username and api_key.

from json import loads from IPython.display import JSON
%env USERNAME= %env API_KEY= %env DATAPLATFORM_URL= %env SPACE_ID=

Getting WML authorization token for further cURL calls

%%bash --out token token=$(curl -sk -X POST \ --header "Content-type: application/json" \ -d "{\"username\":\"${USERNAME}\",\"api_key\":\"${API_KEY}\"}" \ "$DATAPLATFORM_URL/icp4d-api/v1/authorize") token=${token#*token\":\"} token=${token%%\"*} echo $token
%env TOKEN=$token
env: TOKEN=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImdOTEJmb0QwXzE2Vy1rMDBXdzFCX3BrMFFCSjhLTFo0N2pMaUs5a3VQX3cifQ.eyJ1c2VybmFtZSI6ImFkbWluIiwicm9sZSI6IkFkbWluIiwicGVybWlzc2lvbnMiOlsiYWRtaW5pc3RyYXRvciIsImNhbl9wcm92aXNpb24iLCJtYW5hZ2VfY2F0YWxvZyIsImFjY2Vzc19jYXRhbG9nIl0sImdyb3VwcyI6WzEwMDAwXSwic3ViIjoiYWRtaW4iLCJpc3MiOiJLTk9YU1NPIiwiYXVkIjoiRFNYIiwidWlkIjoiMTAwMDMzMDk5OSIsImF1dGhlbnRpY2F0b3IiOiJkZWZhdWx0IiwiaWF0IjoxNjE4MjI4OTQwLCJleHAiOjE2MTgyNzIxMDR9.VyLudRtpd0seOsJ3Dsnf86dfK9QAKAXeFZ45yBNGAcY5A343ncnLRaOGi50URVC5pZwiMmCFDZjQwLdQfi5Z-2cQEllfD7B9v7sxnuThKtHKh_wp0Nm0IqR9Sus086dw88STULHCYSkblpDHOPdhVdwxnapBEDV8RYMOGkdWo7RO-83w7QCkXKRLW3SraRuobaU8UPhu-H3F7Gk-Bi-xa1XTeoOad-tOS90X-mCC4PL6Rvra61DU-UQkMkQ8vxYSg3QKihIrnB227jlX5QUUW6rZBby_zkMF9P0bb3J0Z4-wFdxmEJBxh7hBC0n-dzZ2KnKUy8V5OyvIXIN91VD-gQ

Space creation

Tip: If you do not have space already created, please convert below three cells to code and run them.

First of all, you need to create a space that will be used in all of your further cURL calls. If you do not have space already created, below is the cURL call to create one.

<a href="https://cpd-spaces-api.eu-gb.cf.appdomain.cloud/#/Spaces/spaces_create" target="_blank" rel="noopener no referrer">Space creation

%%bash --out space_id curl -sk -X POST \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data '{"name": "curl_DL"}' \ "$DATAPLATFORM_URL/v2/spaces" \ | grep '"id": ' | awk -F '"' '{ print $4 }'
space_id = space_id.split('\n')[1] %env SPACE_ID=$space_id

Space creation is asynchronous. This means that you need to check space creation status after creation call. Make sure that your newly created space is active.

<a href="https://cpd-spaces-api.eu-gb.cf.appdomain.cloud/#/Spaces/spaces_get" target="_blank" rel="noopener no referrer">Get space information

%%bash curl -sk -X GET \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/v2/spaces/$SPACE_ID"

2. Model definition

This section provides samples about how to store model definition via cURL calls.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Model Definitions/model_definitions_create" target="_blank" rel="noopener no referrer">Store a model definition for Deep Learning experiment

%%bash --out model_definition_payload MODEL_DEFINITION_PAYLOAD='{"name": "mlp-model-definition", "space_id": "'"$SPACE_ID"'", "description": "mlp-model-definition", "tags": ["DL", "MNIST"], "version": "v1", "platform": {"name": "python", "versions": ["3.9"]}, "command": "mnist_mlp.py"}' echo $MODEL_DEFINITION_PAYLOAD
JSON(loads(model_definition_payload))
<IPython.core.display.JSON object>
%env MODEL_DEFINITION_PAYLOAD=$model_definition_payload
env: MODEL_DEFINITION_PAYLOAD={"name": "mlp-model-definition", "space_id": "", "description": "mlp-model-definition", "tags": ["DL", "MNIST"], "version": "v1", "platform": {"name": "python", "versions": ["3.9"]}, "command": "mnist_mlp.py"}
%%bash --out model_definition_id curl -sk -X POST \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "$MODEL_DEFINITION_PAYLOAD" \ "$DATAPLATFORM_URL/ml/v4/model_definitions?version=2020-08-01"| grep '"id": ' | awk -F '"' '{ print $4 }'
%env MODEL_DEFINITION_ID=$model_definition_id
env: MODEL_DEFINITION_ID=e6bae5f3-cdf8-4618-9785-1d9f3e26b24c

Model preparation

Download files with keras code. You can either download it via link below or run the cell below the link.

<a href="https://github.com/IBM/watson-machine-learning-samples/raw/master/definitions/keras/mnist/MNIST.zip" target="_blank" rel="noopener no referrer">Download MNIST.zip

%%bash wget -q https://github.com/IBM/watson-machine-learning-samples/raw/master/cpd4.5/definitions/keras/mnist/MNIST.zip \ -O MNIST.zip

Tip: Convert below cell to code and run it to see model deinition's code.

!unzip -oqd . MNIST.zip && cat mnist_mlp.py

Upload model for the model definition

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Model Definitions/model_definitions_upload_model" target="_blank" rel="noopener no referrer">Upload model for the model definition

%%bash curl -sk -X PUT \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data-binary "@MNIST.zip" \ "$DATAPLATFORM_URL/ml/v4/model_definitions/$MODEL_DEFINITION_ID/model?version=2020-08-01&space_id=$SPACE_ID" \ | python -m json.tool
{ "attachment_id": "e859e066-0500-49eb-bb12-7106eefc9803", "content_format": "native", "persisted": true }

3. Experiment run

This section provides samples about how to trigger Deep Learning experiment via cURL calls.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Trainings/trainings_create" target="_blank" rel="noopener no referrer">Schedule a training job for Deep Learning experiment

Specify the source files folder where you have stored your training data. The path should point to a local repository on Watson Machine Learning Accelerator that your system administrator has set up for your use.

Action: Change training_data_references: location: path: ...

%%bash --out training_payload TRAINING_PAYLOAD='{"training_data_references": [{"name": "training_input_data", "type": "fs", "connection": {}, "location": {"path": "tf-mnist"}, "schema": {"id": "idmlp_schema", "fields": [{"name": "text", "type": "string"}]}}], "results_reference": {"name": "MNIST results", "connection": {}, "location": {"path": "spaces/'"$SPACE_ID"'/assets/experiment"}, "type": "fs"}, "tags": [{"value": "tags_keras", "description": "Tags Keras"}], "name": "Keras hand-written Digit Recognition", "description": "Keras hand-written Digit Recognition", "model_definition": {"id": "'"$MODEL_DEFINITION_ID"'", "command": "mnist_mlp.py", "hardware_spec": {"name": "K80", "nodes": 1}, "software_spec": {"name": "tensorflow_rt22.1-py3.9"}, "parameters": {"name": "Keras_mnist", "description": "Keras mnist recognition"}}, "space_id": "'"$SPACE_ID"'"}' echo $TRAINING_PAYLOAD
JSON(loads(training_payload))
<IPython.core.display.JSON object>
%env TRAINING_PAYLOAD=$training_payload
env: TRAINING_PAYLOAD={"training_data_references": [{"name": "training_input_data", "type": "fs", "connection": {}, "location": {"path": "tf-mnist"}, "schema": {"id": "idmlp_schema", "fields": [{"name": "text", "type": "string"}]}}], "results_reference": {"name": "MNIST results", "connection": {}, "location": {"path": "spaces//assets/experiment"}, "type": "fs"}, "tags": [{"value": "tags_keras", "description": "Tags Keras"}], "name": "Keras hand-written Digit Recognition", "description": "Keras hand-written Digit Recognition", "model_definition": {"id": "", "command": "mnist_mlp.py", "hardware_spec": {"name": "K80", "nodes": 1}, "software_spec": {"name": "tensorflow_rt22.1-py3.9"}, "parameters": {"name": "Keras_mnist", "description": "Keras mnist recognition"}}, "space_id": ""}
%%bash --out training_id curl -sk -X POST \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "$TRAINING_PAYLOAD" \ "$DATAPLATFORM_URL/ml/v4/trainings?version=2020-08-01" | awk -F'"id":' '{print $2}' | cut -c2-37
%env TRAINING_ID=$training_id
env: TRAINING_ID=76cd30e3-8305-4f02-8e7f-f6a78d85cd48

Get training details

Treining is an asynchronous endpoint. In case you want to monitor training status and details, you need to use a GET method and specify which training you want to monitor by usage of training ID.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Trainings/trainings_get" target="_blank" rel="noopener no referrer">Get information about training job

%%bash curl -sk -X GET \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/ml/v4/trainings/$TRAINING_ID?space_id=$SPACE_ID&version=2020-08-01" \ | python -m json.tool

Get training status

%%bash STATUS=$(curl -sk -X GET\ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/ml/v4/trainings/$TRAINING_ID?space_id=$SPACE_ID&version=2020-08-01") STATUS=${STATUS#*state\":\"} STATUS=${STATUS%%\"*} echo $STATUS
completed

Please make sure that training is completed before you go to the next sections. Monitor state of your training by running above cell couple of times.

4. Historical runs

In this section you will see cURL examples describing how to get historical training runs information.

Output should be similar to the output from training creation but you should see more trainings entries. Listing trainings:

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Trainings/trainings_list" target="_blank" rel="noopener no referrer">Get list of historical training jobs information

%%bash HISTORICAL_TRAINING_LIMIT_TO_GET=2 curl -sk -X GET \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/ml/v4/trainings?space_id=$SPACE_ID&version=2020-08-01&limit=$HISTORICAL_TRAINING_LIMIT_TO_GET" \ | python -m json.tool

Cancel training run

Tip: If you want to cancel your training, please convert below cell to code, specify training ID and run.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Trainings/trainings_delete" target="_blank" rel="noopener no referrer">Canceling training

%%bash TRAINING_ID_TO_CANCEL=... curl -sk -X DELETE \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/ml/v4/trainings/$TRAINING_ID_TO_DELETE?space_id=$SPACE_ID&version=2020-08-01"

5. Deploy and Score

In this section you will learn how to deploy and score pipeline model as webservice using WML instance.

Before deployment creation, you need store your model in WML repository. Please see below cURL call example how to do it.

Download request.json with repository request json for model storing.

%%bash --out request_json RJSON=$(curl -sk -X GET \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/v2/asset_files/experiment/$TRAINING_ID/assets/$TRAINING_ID/resources/wml_model/request.json?space_id=$SPACE_ID&version=2020-08-01") echo $RJSON

You can specify user_defined_objects if keras model used any

x = loads(request_json) x['user_defined_objects'] = {} request_json = json.dumps(x)
JSON(loads(request_json))
%env MODEL_PAYLOAD=$request_json
env: MODEL_PAYLOAD={"content_location": {"connection": {}, "contents": [{"content_format": "native", "file_name": "twmla-2692.zip", "location": "spaces/dfabc53a-c862-4a4c-9161-e74d6726629a/assets/experiment/76cd30e3-8305-4f02-8e7f-f6a78d85cd48/assets/76cd30e3-8305-4f02-8e7f-f6a78d85cd48/resources/wml_model/twmla-2692.zip"}], "location": {"path": "spaces/dfabc53a-c862-4a4c-9161-e74d6726629a/assets/experiment", "model": "spaces/dfabc53a-c862-4a4c-9161-e74d6726629a/assets/experiment/76cd30e3-8305-4f02-8e7f-f6a78d85cd48/data/model", "training": "spaces/dfabc53a-c862-4a4c-9161-e74d6726629a/assets/experiment/76cd30e3-8305-4f02-8e7f-f6a78d85cd48", "training_status": "spaces/dfabc53a-c862-4a4c-9161-e74d6726629a/assets/experiment/76cd30e3-8305-4f02-8e7f-f6a78d85cd48/training-status.json", "logs": "spaces/dfabc53a-c862-4a4c-9161-e74d6726629a/assets/experiment/76cd30e3-8305-4f02-8e7f-f6a78d85cd48/logs", "assets_path": "spaces/dfabc53a-c862-4a4c-9161-e74d6726629a/assets/experiment/76cd30e3-8305-4f02-8e7f-f6a78d85cd48/assets"}, "type": "fs"}, "model_definition": {"id": "e6bae5f3-cdf8-4618-9785-1d9f3e26b24c"}, "name": "model_twmla-2692", "software_spec": {"name": "tensorflow_2.1-py3.7"}, "space_id": "dfabc53a-c862-4a4c-9161-e74d6726629a", "training_data_references": [{"connection": {}, "location": {"path": "tf-mnist"}, "schema": {"fields": [{"name": "text", "type": "string"}], "id": "idmlp_schema"}, "type": "fs"}], "type": "tensorflow_2.1", "user_defined_objects": {}}

Store Deep Learning model

Store information about your model to WML repository.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Models/models_create" target="_blank" rel="noopener no referrer">Model storing

%%bash --out model_details MODEL_DETAILS=$(curl -sk -X POST \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "$MODEL_PAYLOAD" \ "$DATAPLATFORM_URL/ml/v4/models?version=2020-08-01&space_id=$SPACE_ID") echo $MODEL_DETAILS
JSON(loads(model_details))
%env MODEL_DETAILS=$model_details
%%bash --out model_id echo $MODEL_DETAILS | awk -F '"id": ' '{ print $5 }' | cut -d '"' -f 2
%env MODEL_ID=$model_id
env: MODEL_ID=a657159a-c30a-4d84-908d-ee0668247ac2

Deployment creation

An Deep Learning online deployment creation is presented below.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Deployments/deployments_create" target="_blank" rel="noopener no referrer">Create deployment

%%bash --out deployment_payload DEPLOYMENT_PAYLOAD='{"space_id": "'"$SPACE_ID"'","name": "MNIST deployment", "description": "This is description","online": {},"hardware_spec": {"name": "S"},"asset": {"id": "'"$MODEL_ID"'"}}' echo $DEPLOYMENT_PAYLOAD
JSON(loads(deployment_payload))
%env DEPLOYMENT_PAYLOAD=$deployment_payload
env: DEPLOYMENT_PAYLOAD={"space_id": "","name": "MNIST deployment", "description": "This is description","online": {},"hardware_spec": {"name": "S"},"asset": {"id": ""}}
%%bash --out deployment_id curl -sk -X POST \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data "$DEPLOYMENT_PAYLOAD" \ "$DATAPLATFORM_URL/ml/v4/deployments?version=2020-08-01" | grep '"id": ' | awk -F '"' '{ print $4 }' | sed -n 3p
%env DEPLOYMENT_ID=$deployment_id
env: DEPLOYMENT_ID=5331365c-c410-4888-874f-a5eec62c1c1f

Get deployment details

As deployment API is asynchronous, please make sure your deployment is in ready state before going to the next points.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Deployments/deployments_get" target="_blank" rel="noopener no referrer">Get deployment details

%%bash curl -sk -X GET \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ "$DATAPLATFORM_URL/ml/v4/deployments/$DEPLOYMENT_ID?space_id=$SPACE_ID&version=2020-08-01" \ | python -m json.tool

Prepare scoring input data

Hint: You may need to install numpy using following command !pip install numpy

import numpy as np mnist_dataset = np.load('mnist.npz') test_mnist = mnist_dataset['x_test']
image_1 = (test_mnist[0].ravel() / 255).tolist() image_2 = (test_mnist[1].ravel() / 255).tolist()
%matplotlib inline import matplotlib.pyplot as plt
for i, image in enumerate([test_mnist[0], test_mnist[1]]): plt.subplot(2, 2, i + 1) plt.axis('off') plt.imshow(image, cmap=plt.cm.gray_r, interpolation='nearest')
Image in a Jupyter notebook

Scoring of a webservice

If you want to make a score call on your deployment, please follow a below method:

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Deployment Jobs/deployment_jobs_create" target="_blank" rel="noopener no referrer">Create deployment job

%%bash -s "$image_1" "$image_2" curl -sk -X POST \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ --data '{"space_id": "$SPACE_ID","input_data": [{"values": ['"$1"', '"$2"']}]}' \ "$DATAPLATFORM_URL/ml/v4/deployments/$DEPLOYMENT_ID/predictions?version=2020-08-01" \ | python -m json.tool
{ "predictions": [ { "id": "dense_2", "fields": [ "prediction", "prediction_classes", "probability" ], "values": [ [ [ 1.9900074643697252e-11, 3.822798966268692e-09, 2.4224431172115146e-07, 5.15271153744834e-07, 4.8153681563023465e-12, 2.691485090355883e-10, 3.7727591933257835e-17, 0.9999992847442627, 6.239881389369373e-10, 1.9525142391785266e-08 ], 7, [ 1.9900074643697252e-11, 3.822798966268692e-09, 2.4224431172115146e-07, 5.15271153744834e-07, 4.8153681563023465e-12, 2.691485090355883e-10, 3.7727591933257835e-17, 0.9999992847442627, 6.239881389369373e-10, 1.9525142391785266e-08 ] ], [ [ 3.6698760350062365e-12, 6.7591809056466445e-06, 0.9999932050704956, 1.686822015400935e-09, 6.775461543712471e-16, 1.3138171973958723e-11, 3.2214782057227165e-12, 7.394793870123262e-13, 3.1172808778734407e-09, 6.7135277188365434e-18 ], 2, [ 3.6698760350062365e-12, 6.7591809056466445e-06, 0.9999932050704956, 1.686822015400935e-09, 6.775461543712471e-16, 1.3138171973958723e-11, 3.2214782057227165e-12, 7.394793870123262e-13, 3.1172808778734407e-09, 6.7135277188365434e-18 ] ] ] } ] }

Listing all deployments

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Deployments/deployments_list" target="_blank" rel="noopener no referrer">List deployments details

%%bash curl -sk -X GET \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ "$DATAPLATFORM_URL/ml/v4/deployments?space_id=$SPACE_ID&version=2020-08-01" \ | python -m json.tool

6. Cleaning section

Below section is useful when you want to clean all of your previous work within this notebook. Just convert below cells into the code and run them.

Delete training run

Tip: You can completely delete a training run with its metadata.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Trainings/trainings_delete" target="_blank" rel="noopener no referrer">Deleting training

%%bash %env TRAINING_ID_TO_DELETE=... curl -sk -X DELETE \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/ml/v4/trainings/$TRAINING_ID_TO_DELETE?space_id=$SPACE_ID&version=2020-08-01&hard_delete=true"

Deleting deployment

Tip: You can delete existing deployment by calling DELETE method.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Deployments/deployments_delete" target="_blank" rel="noopener no referrer">Delete deployment

%%bash curl -sk -X DELETE \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ "$DATAPLATFORM_URL/ml/v4/deployments/$DEPLOYMENT_ID?space_id=$SPACE_ID&version=2020-08-01"

Delete model from repository

Tip: If you want to completely remove your stored model and model metadata, just use a DELETE method.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Models/models_delete" target="_blank" rel="noopener no referrer">Delete model from repository

%%bash curl -sk -X DELETE \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ "$DATAPLATFORM_URL/ml/v4/models/$MODEL_ID?space_id=$SPACE_ID&version=2020-08-01"

Delete model definition

Tip: If you want to completely remove your model definition, just use a DELETE method.

<a href="https://watson-ml-v4-api.mybluemix.net/wml-restapi-cloud.html#/Model Definitions/model_definitions_delete" target="_blank" rel="noopener no referrer">Delete model definition

%%bash curl -sk -X DELETE \ --header "Authorization: Bearer $TOKEN" \ --header "Content-Type: application/json" \ "$DATAPLATFORM_URL/ml/v4/model_definitions/$MODEL_DEFINITION_ID?space_id=$SPACE_ID&version=2020-08-01"

7. Summary and next steps

You successfully completed this notebook!.

You learned how to use cURL calls to store, deploy and score a Keras Deep Learning model in WML.

Authors

Jan Sołtysik, Intern in Watson Machine Learning at IBM

Copyright © 2020-2025 IBM. This notebook and its source code are released under the terms of the MIT License.