Using Script Mode with Amazon SageMaker

  Рет қаралды 11,790

Julien Simon

Julien Simon

Күн бұрын

Пікірлер: 43
@aprilwang6036
@aprilwang6036 2 жыл бұрын
Thank you very much for the video, it bridged the gap in the knowledge on the official doc and most tutorials elsewhere where you touched upon how sagemaker interacts with the training script. As someone new to AWS, I initially assumed that sagemaker 'imports' the training script, therefore I was very confused about why so many codes put the training part in the __main__ block. With your explanation about the docker thing, it made sense, and I finally understood the argparse part as well. I wish the sagemaker SDK would actually explain that part. Again, thanks!
@philippluniak5855
@philippluniak5855 2 жыл бұрын
I second that. The SDK docs don't explain well how the script and the container interact. Thanks for filling that gap, Julien!
@juliensimonfr
@juliensimonfr Жыл бұрын
Glad it helped :)
@akhil-menon
@akhil-menon Жыл бұрын
This is such a real problem. It took me many hours of reading and research to understand the intuition behind putting the training code in a separate py file. But once I got that, this video really helped plug everything together. Thanks a lot Julien!
@juliensimonfr
@juliensimonfr Жыл бұрын
@@akhil-menon Glad I could help!
@gravitycuda
@gravitycuda 4 жыл бұрын
Best ever tutorial on how to use Script mode in Sagemaker, Thank you very much Julien. I am happy that I am the first one to comment.
@juliensimonfr
@juliensimonfr 4 жыл бұрын
You're welcome!
@arvindramanathan329
@arvindramanathan329 3 жыл бұрын
Simple and clear explanation. Thanks!
@juliensimonfr
@juliensimonfr 3 жыл бұрын
Glad it was helpful!
@vinayaknayak7374
@vinayaknayak7374 3 жыл бұрын
Thanks for this tutorial, this was really helpful!
@juliensimonfr
@juliensimonfr 3 жыл бұрын
You're welcome!
@pielatsch9959
@pielatsch9959 3 жыл бұрын
Great tutorial! Much appreciated! Greetings from Hamburg
@juliensimonfr
@juliensimonfr 3 жыл бұрын
Thanks for watching!
@knockedhimover
@knockedhimover 2 жыл бұрын
Thank you Julien. Realy helpful
@juliensimonfr
@juliensimonfr 2 жыл бұрын
My pleasure!
@vidhipatel526
@vidhipatel526 2 жыл бұрын
Thank you so much for this amazing tutorial 👍
@juliensimonfr
@juliensimonfr 2 жыл бұрын
My pleasure 😊
@tranhieu3982
@tranhieu3982 4 жыл бұрын
Thanks Julien, I have a question. How can we specify the cuda version in the training instance because tensorflow 2.3 only works with cuda 10.1 or higher but the ml.p2.xlarge auto specify the cuda 10.0?
@juliensimonfr
@juliensimonfr 3 жыл бұрын
I don't think you can do that with the built-in containers. Either wait for us to release TF 2.3, or try building your own container.
@DL-tl5wx
@DL-tl5wx 3 жыл бұрын
Hi, thank you for the great tutorial! I am wondering if the inference code could be added somewhere to script.py, so I could pass an unprocessed image to the endpoint to get the predictions?
@juliensimonfr
@juliensimonfr 3 жыл бұрын
Hi, yes, you can pass an inference script when working with built-in frameworks. For example, with Tensorflow, look for "How to implement the pre- and/or post-processing handler(s)" at sagemaker.readthedocs.io/en/stable/frameworks/tensorflow/deploying_tensorflow_serving.html
@DL-tl5wx
@DL-tl5wx 3 жыл бұрын
@@juliensimonfr oh, great! Thank you so much!
@barinderthind
@barinderthind Жыл бұрын
How would I use a custom model and not tensorflow? For example, a Prophet model; I followed this tutorial to the point where I was able to run my training script through terminal and passing in arguments through terminal but after that, it seems purely geared towards tensorflow
@juliensimonfr
@juliensimonfr Жыл бұрын
You can use Script Mode with any algo. However, to use Prophet, you would need either a custom container, see docs.aws.amazon.com/sagemaker/latest/dg/docker-containers-adapt-your-own.html
@zeehanrahman6932
@zeehanrahman6932 2 жыл бұрын
Hello, thank you for the helpful tutorial. May you please explain how sagemaker is able to read the training script? Are we supposed to upload the training script to an S3 bucket as well?
@juliensimonfr
@juliensimonfr 2 жыл бұрын
No, this is done automatically by the Estimator.
@rafikferraoun3041
@rafikferraoun3041 2 жыл бұрын
Hello, Thank you Julien for this tutorial ! I am wondering if and how can I use kfold cross validation while training my keras models and use script mode to implement it ?
@juliensimonfr
@juliensimonfr 2 жыл бұрын
Sure, it's your code :) You could run k-fold validation once the model is trained, write results to a file located in the same directory as the trained model, and grab them in the model artefact once training is complete.
@harisseyassine8483
@harisseyassine8483 2 жыл бұрын
how can i set the tensorflow_p36 in the terminal ?
@juliensimonfr
@juliensimonfr 2 жыл бұрын
You need to set the kernel in the notebook. You can create your own with conda if needed.
@sachavanweeren9578
@sachavanweeren9578 3 жыл бұрын
I have a question - using tensorflow 2 how would you save a keras model? Can you explain or do you have a link for this
@juliensimonfr
@juliensimonfr 3 жыл бұрын
www.tensorflow.org/guide/keras/save_and_serialize
@MuhammadAli-mi5gg
@MuhammadAli-mi5gg 3 жыл бұрын
Hello, I couldnot train the model on local-gpu...following error message is showed... RuntimeError: Failed to run: ['docker-compose', '-f', '/tmp/tmpv__81ldz/docker-compose.yaml', 'up', '--build', '--abort-on-container-exit'], Process exited with code: 1 Please, guide me, and I am completely at sea ,if you talk about dockers... Thnaks
@juliensimonfr
@juliensimonfr 3 жыл бұрын
is Docker running on your machine ? If you're confused about docker, please learn about that first. Docker.com has a good tutorial.
@gravitycuda
@gravitycuda 4 жыл бұрын
Can you please tell me, how did you activate the terminal to have tensorflow_p36 environment. Thanks
@juliensimonfr
@juliensimonfr 4 жыл бұрын
Open a terminal in Jupyter ("New" dropdown on the right side), and type 'source activate tensorflow_p36'
@vinayaknayak7374
@vinayaknayak7374 3 жыл бұрын
Hi Julien! If I want to use code from other helper funtions written in separate python files (.py files) in the same source_dir as the script.py file, what should I do? For eg. I have a utils.py file in my source_dir alongside the script.py file. Now, I am importing get_feature_vector function procedure from utils.py file in my script.py file. How can I do this, could you please guide? Thanks, Vinayak.
@vinayaknayak7374
@vinayaknayak7374 3 жыл бұрын
Sorry, these files got copied in the docker container as well. I thought it was only the script.py file that gets copied. Thanks. Resolved the issue :)
@juliensimonfr
@juliensimonfr 3 жыл бұрын
cool :)
@jessehao590
@jessehao590 3 жыл бұрын
Thanks for your video. However, I did a test based on this code Can I set train_instance_count=2, and what does this mean, thanks. Confused.
@juliensimonfr
@juliensimonfr 3 жыл бұрын
This is called distributed training, where several instances collaborate on the same training job. All Deep Learning libraries support it, for instance aws.amazon.com/blogs/machine-learning/running-distributed-tensorflow-training-with-amazon-sagemaker/
@jessehao590
@jessehao590 3 жыл бұрын
​@@juliensimonfr Thanks for your reply. Amazing, If possible, I expect some videos on the relationship between Ray, Horovod, SageMaker. Is SageMaker not enough? Why do we consider Ray for example? Really appreciate.
@juliensimonfr
@juliensimonfr 3 жыл бұрын
Horovod is built in SageMaker. Nothing to add, e.g. aws.amazon.com/blogs/machine-learning/multi-gpu-and-distributed-training-using-horovod-in-amazon-sagemaker-pipe-mode/
YOUR CODE! AT SCALE! Amazon SageMaker Script Mode
30:13
mikegchambers
Рет қаралды 10 М.
Amazon SageMaker Studio - Managed Spot Training
11:54
Julien Simon
Рет қаралды 2,5 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 42 МЛН
АЗАРТНИК 4 |СЕЗОН 2 Серия
31:45
Inter Production
Рет қаралды 849 М.
Cute kitty gadgets 💛
00:24
TheSoul Music Family
Рет қаралды 21 МЛН
1ОШБ Да Вінчі навчання
00:14
AIRSOFT BALAN
Рет қаралды 5 МЛН
Model deployment scenarios on Amazon SageMaker
13:21
Julien Simon
Рет қаралды 6 М.
Summarizing legal documents with Hugging Face and Amazon SageMaker
21:55
SageMaker JumpStart: deploy Hugging Face models in minutes!
8:23
Game On! - SageMaker STUDIO vs SageMaker NOTEBOOKS
11:53
mikegchambers
Рет қаралды 22 М.
Deploy your own pre-trained Keras model to aws Sagemaker
15:09
Amazon SageMaker Studio - Deploying a model to an endpoint
9:09
Julien Simon
Рет қаралды 26 М.
Automate Your AI/ML Workflows with SageMaker Pipelines
29:52
Generative AI on AWS
Рет қаралды 26 М.
1/2 Train Custom TensorFlow Algorithms in SageMaker · Talk · Part 1
11:36
Nono Martínez Alonso
Рет қаралды 2,9 М.
Parameter-efficient fine-tuning with QLoRA and Hugging Face
22:51
Julien Simon
Рет қаралды 2,6 М.
The Joker kisses Harley Quinn underwater!#Harley Quinn #joker
00:49
Harley Quinn with the Joker
Рет қаралды 42 МЛН