Skip to content

Latest commit

 

History

History
108 lines (81 loc) · 7.23 KB

prerequisites_win.md

File metadata and controls

108 lines (81 loc) · 7.23 KB

SAP AI Core exercises - Windows

These instructions are for Windows users. If you are a MacOS or Linux user, please check out the MacOS/Linux 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.

2. Install Git and clone bootcamp repositories

  • Install Git following the instructions here.

  • Clone btp-ai-sustainability-bootcamp repository. This is the main bootcamp repository containing all the necessary code. To clone the repo, start the Git Bash that was installed with git and type these following commands:

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

If needed, a guide on how to clone a repository can be found here.

  • 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. Once you have created it, open a Git Bash and type the following commands to clone your repo:
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. For the exercises, we have used Python3.8.9.

  • Install Python3.8.9 from this website. Scroll down to Files and pick the recommended Windows installer, normally it should do.

    • When the installation starts, select the flag to add Python 3.8 to PATH
    • Select Customize Installation, do not change any option and click Next.
    • You will then be in Advanced Option. Under Customize install location change the path to C:\Python389. Then click Install
  • Create a virtual environment and install the requirements: open a Git Bash , type the following commands:

cd sap_aicore_bootcamp
pip install virtualenv
virtualenv -p /c/Python389/python.exe bootcamp_venv
source bootcamp_venv/Scripts/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 Git Bash and type:

cd sap_aicore_bootcamp/btp-ai-sustainability-bootcamp
git pull
cd ..
source bootcamp_venv/Scripts/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.