Skip to content

Latest commit

 

History

History
110 lines (81 loc) · 7.14 KB

prerequisites.md

File metadata and controls

110 lines (81 loc) · 7.14 KB

SAP AI Core exercises - Linux, MacOS

These instructions are for MacOS or Linux users. If you are a Windows user, please check out the Windows instructions here.

Prerequisites

0. Free Tier plan for SAP AI Core and SAP AI Launchpad

In order to go through the exercises proposed in this OpenSAP course, you need an AI Core instance and a subscription to AI Launchpad. Both are available in the SAP BTP Free Tier plan (more information can be found at this blog post).

You can follow this tutorial to setup free tier for SAP AI Core and SAP AI Launchpad in your BTP global account (or subaccount). Follow the tutorial until Set Up Tools to Connect With and Operate SAP AI Core - STEP 3 - Set up tools for usage with SAP AI Core.

🔴 IMPORTANT WARNINGS:

  • BTP Free Tier VS BTP Trial ⚠️- SAP AI Core and SAP AI Launchpad are available in BTP Free Tier, while they are NOT available in BTP Trial. About the difference between the two please refer to this video. If you need to set up a BTP account to activate Free Tier Service plans, follow this link.
  • Free Tier limitations ⚠️- The free tier AI Core and AI Launchpad are free of charge, but they have some limitations, for instance in the use of GPU acceleration. You can check all the limitations at this link. The exercises in this specific branch of the repository we are providing are meant to be executed with the free tier plan, so they are tailored for that. In case you are going to use the standard (paid) plan for AI Core and AI Launchpad, you can refer to this branch where the same exercises are sized to exploit the full capabilities of these two products.
  • Troubleshooting - If you have doubts or issues in setting up your BTP account or your SAP AI Core instance, you can check our cheatsheet.

1. Install Docker Desktop and create a personal Docker Registry

Instructions can be found here, Step 1 to 4. We recommend you to create an access token to be used in place of your password. Instructions on how to generate a token can be found here.

2. Install Git and clone bootcamp repositories

mkdir sap_aicore_bootcamp
cd sap_aicore_bootcamp
git clone https://github.com/SAP-samples/btp-ai-sustainability-bootcamp.git
cd btp-ai-sustainability-bootcamp
git checkout opensap-freetier

In case of issues, please check out how to clone a repository at this link.

  • Create your Github repository for AI Core templates. This is the GitHub repository that you have to create in order to go through the exercises of this OpenSAP course. The repository will host the AI Core (training and serving) templates and will be synchronized with the AI Core environment. Create a new repository in your Github account and give it an arbitrary name that we will refer to as <YOUR-GITHUB-REPO>. Instructions on how to create a repository are available here. Then open a terminal and execute the following commands to clone your repository:
cd sap_aicore_bootcamp
git clone https://github.com/<YOUR-GITHUB-USERNAME>/<YOUR-GITHUB-REPO>.git

3. Install a Python3 environment

To reproduce our AI models and train them in SAP AI Core you will need to have a local Python3 environment, including all the libraries listed in requirements.txt. We have tested the code using Python 3.8.9, so we strongly advise you to stick to this version to avoid any showstopper. Below you can find indicative guidelines to create a virtual environment with all the requirements.

Install a Python3 environment with virtualenv

  • Install virtualenv following instructions here.
  • Open a terminal and execute the following commands:
cd sap_aicore_bootcamp
virtualenv bootcamp_venv
source bootcamp_venv/bin/activate
pip install -r btp-ai-sustainability-bootcamp/prerequisites/requirements.txt

4. Set up an AWS S3 storage bucket

In this course we will use AWS S3 Object Store as a cloud storage for our AI Core datasets and models.You can get an AWS S3 storage bucket from either of these two ways:

Once you have got your S3 bucket:

  1. Install the AWS Command Line Interface
  2. Make sure you are working on the correct branch, opensap-freetier or opensap-standard, depending on the AI Core instance you are working with:
cd sap_aicore_bootcamp/btp-ai-sustainability-bootcamp/
git branch

Use the command:

git checkout <BRANCH_NAME>

to switch to the correct branch if necessary.

  1. Upload the data in S3:
aws s3 cp --recursive src/ai-models/defect-detection/data/Images s3://<YOUR-BUCKET-ID>/image/data/
aws s3 cp --recursive src/ai-models/predictive-maintenance/LGPsound s3://<YOUR-BUCKET-ID>/sound/data/

A complete demo is available in this video

Exercises - BYOM with TensorFlow

Open a terminal and type:

cd sap_aicore_bootcamp/btp-ai-sustainability-bootcamp
git pull
cd ..
source bootcamp_venv/bin/activate
jupyter lab

Exercise 1 - Defect Detection

Jupyter will start in your default browser. In the lefthand side pane, navigate to:

btp-ai-sustainability-bootcamp → src → ai-models → defect-detection → exercises

and double click on defect-detection-part1.ipynb to open it. Follow through the notebook instructions.

Exercise 2 - Sound classification

Jupyter will start in your default browser. In the lefthand side pane, navigate to:

btp-ai-sustainability-bootcamp → src → ai-models → predictive-maintenance → exercises

and double click on sound-classification-part1.ipynb to open it. Follow through the notebook instructions.