sap-tutorials / Tutorials

Tutorials on sap.com
https://developers.sap.com/tutorial-navigator.html
Creative Commons Attribution 4.0 International
693 stars 766 forks source link

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

Open gianfranco-s opened 4 months ago

gianfranco-s commented 4 months ago

Tutorials: https://developers.sap.com/tutorials/ai-core-tensorflow-byod.html

I'm using the Free Tier. I'm fairly certain that this tutorial cannot be completed with GPU nodes The tutorial can be completed without GPU nodes, although ATM I don't have any way to try it with GPU nodes.

I haven't been able to complete this tutorial because there are multiple issues. I have solved all the issues with the tutorial. I'll fork the project, and create a PR.

The first issue appears when trying to register the artifact. It is my understanding (after having tried it multiple times) that the application must be created before registering the model.

Here are my proposed changes

Order Current Proposed
1 Step 1 Step 1
2 Step 2 Step 2
3 Step 3 Step 3
4 Step 4 Step 6
5 Step 5 Step 7
6 Step 6 Step 4
7 Step 7 Step 5
8 Step 8 Step 8
9 Step 9 Step 9

Additional comments on current steps

gianfranco-s commented 4 months ago

I suggest leaving requirements.txt without versions

# requirements.txt
scikit-learn
Flask
gunicorn

And using flag '--ignore-installed' in dockerfile to avoid conflicts with base image packages

RUN pip3 install --ignore-installed -r requirements.txt
gianfranco-s commented 4 months ago

Attribute endpoint is the problem. Should be s3. instead of s3-. Source

gianfranco-s commented 4 months ago

I suggest changing the Dockerfile to this:

FROM tensorflow/tensorflow:2.10.0-gpu-jupyter

This will require to import pad_sequences from keras.utils (instead of keras.preprocessing.sequence)