SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
⤢ Open full site

Use Pre-Trained Tensorflow Models with a GPU in SAP AI Core

Bring a pre-trained text classifier Tensorflow model to SAP AI Core, and write a workflow which will enable GPU deployment of this model, for movie review classification.

Overview

🎓 advanced 45 min. SAP Ai CoreAdvancedArtificial IntelligenceMachine Learning

You will learn

  • How to sync pre-trained model to SAP AI Core
  • How to write a pipeline and necessary docker code to enable GPU deployment.
  • How to deploy an AI model and use it for online inferencing.
Dhrubajyoti Paul D Dhrubajyoti Paul August 23, 2024
Created by January 19, 2022
Contributors

Prerequisites

Prerequisites

Steps

Pre-read

All the required files are available for download in the specified step, so that you can easily complete the tutorial.

Intro

This tutorial demonstrates a use-case in which you have trained an ML model on your local computer and would like to deploy this model to production with SAP AI Core.

The model used in this example uses a pre-trained embedding layer of GloVe followed by custom stack of neural network layers for fine tuning. Please find the following tutorials used as reference for the same.

By the end of this tutorial you will have a movie review classification model deployed in SAP AI Core, using which you can make predictions in real-time.

You may complete each step of this tutorial using any of the following tools to control operations in your SAP AI Core:

  • Postman
  • SAP AI Core SDK (demonstrated below)
  • AI API client SDK

Please complete the prerequisites before you get started.


Step 1 Create workspace (resource group)

Create a resource group with ID tf-demo. You may use any existing resource group or even create multiple resource groups with different IDs.

Python
response = ai_core_client.resource_groups.create("tf-demo")

List all the resource groups IDs to confirm creation.

Python
response = ai_core_client.resource_groups.query()

for rg in response.resources:
    print(rg.resource_group_id)

img
img

Step 2 Upload model files to AWS S3
+
Step 3 Connect AWS S3 to SAP AI Core
+
Step 4 Create workflow to serve your model
+
Step 5 Sync workflow with SAP AI Core
+
Step 6 Register model as artifact
+
Step 7 Set up serving code
+
Step 8 Create configuration for deployment
+
Step 9 Start deployment
+
Step 10 Check deployment status
+
Step 11 Make a prediction
+
Step 12 Verify GPU availability
+
Step 13 Stop deployment
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 13
1. Create workspace (resource group) 2. Upload model files to AWS S3 3. Connect AWS S3 to SAP AI Core 4. Create workflow to serve your model 5. Sync workflow with SAP AI Core 6. Register model as artifact 7. Set up serving code 8. Create configuration for deployment 9. Start deployment 10. Check deployment status 11. Make a prediction 12. Verify GPU availability 13. Stop deployment

Learn more →