Create & Deploy A Deep Learning App - PyTorch Model Deployment With Flask & Heroku

  Рет қаралды 48,519

Patrick Loeber

Patrick Loeber

3 жыл бұрын

Create and Deploy your first Deep Learning app! In this PyTorch tutorial we learn how to deploy our PyTorch model with Flask and Heroku.
We create a simple Flask app with a REST API that returns the result as json data, and then we deploy it to Heroku. As an example PytTorch app we do digit classification, and at the end I show you how I draw my own digits and then predict it with our live running app.
~~~~~~~~~~~~~~ GREAT PLUGINS FOR YOUR CODE EDITOR ~~~~~~~~~~~~~~
✅ Write cleaner code with Sourcery: sourcery.ai/?... *
📚 Get my FREE NumPy Handbook:
www.python-engineer.com/numpy...
📓 Notebooks available on Patreon:
/ patrickloeber
⭐ Join Our Discord : / discord
If you enjoyed this video, please subscribe to the channel!
Code:
github.com/patrickloeber/pyto...
Links:
Flask installation:
flask.palletsprojects.com/en/...
PyTorch course & code:
• PyTorch Tutorials - Co...
github.com/patrickloeber/pyto...
PyTorch:
pytorch.org/
Heroku:
www.heroku.com/
You can find me here:
Website: www.python-engineer.com
Twitter: / patloeber
GitHub: github.com/patrickloeber
#PyTorch
----------------------------------------------------------------------------------------------------------
* This is a sponsored link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏

Пікірлер: 72
@patloeber
@patloeber 3 жыл бұрын
If you build your own ML/DL web apps after this tutorial, feel free to share your GitHub repo here :)
@IAmTheMainCharacter
@IAmTheMainCharacter 3 жыл бұрын
will do,
@sarahjamal86
@sarahjamal86 3 жыл бұрын
Can’t wait to finish work and do this video 😍
@patloeber
@patloeber 3 жыл бұрын
Nice! I hope you like it!
@tafikelmehdi2913
@tafikelmehdi2913 3 жыл бұрын
A covid-19 prediction using chest x-ray images webapp : github.com/Avant-Gardiste/Machine-Learning-Portfolio/tree/master/Deep%20Learning/Detecting%20COVID-19%20with%20Chest%20X-Ray
@krinodagamer6313
@krinodagamer6313 2 жыл бұрын
ok
@JosephRivera517
@JosephRivera517 3 жыл бұрын
This is really a great help for beginners.
@patloeber
@patloeber 3 жыл бұрын
thanks!
@HassanHayatch
@HassanHayatch 3 жыл бұрын
Thanks, your tutorials are really amazing.
@patloeber
@patloeber 3 жыл бұрын
Thanks :)
@muralikrishnapolipallivenk2572
@muralikrishnapolipallivenk2572 3 жыл бұрын
Thank you very much, Right On Time when I need it
@patloeber
@patloeber 3 жыл бұрын
You're welcome :)
@emadgirgis6689
@emadgirgis6689 3 жыл бұрын
Amazing work. Thank you.
@patloeber
@patloeber 3 жыл бұрын
Glad you like it :)
@arshadAlieusafzay
@arshadAlieusafzay 3 жыл бұрын
excellent tutorial. many thanks
@patloeber
@patloeber 3 жыл бұрын
glad you like it :)
@yevg3907
@yevg3907 3 жыл бұрын
Great stuff surprised you didn’t finish your stuff with a simple front end maybe next part
@patloeber
@patloeber 3 жыл бұрын
Yes it was mainly about deploying a REST API, but maybe next time with Frontend
@HighInFlavour
@HighInFlavour 3 жыл бұрын
Hi, do you have any tutorial on integrating a PyTorch chatbot into HTML? I followed your Chatbot with PyTorch tutorial (really great tutorial) and I have an HTML template which receives user input. How do I converse with the chatbot inside the html file instead of the terminal?
@2LazySnake
@2LazySnake 3 жыл бұрын
Thank you very much!
@patloeber
@patloeber 3 жыл бұрын
glad you like it!
@2LazySnake
@2LazySnake 3 жыл бұрын
@@patloeber senpai noticed me!
@raminessalat9803
@raminessalat9803 3 жыл бұрын
I felt that I dont have the background to learn this tutorial, can you suggest some links to learn flask and horuku? cuz this was the first time i was hearing them
@firuzjuraev5383
@firuzjuraev5383 Жыл бұрын
Mind-blowing. Just amazing tutorial
@manishsharma2211
@manishsharma2211 3 жыл бұрын
Thank you. I love how you say "Hey everybody"😌😌😌
@patloeber
@patloeber 3 жыл бұрын
Haha thanks :)
@gurjeet333
@gurjeet333 3 жыл бұрын
Hi, thanks for the wonderful video, it would be better you u can develop a complete UI experience rather than coming to terminal to view the predection
@taneryilmaz6171
@taneryilmaz6171 3 жыл бұрын
I wonder can we extract data from pdf math graph useing pytorch CNN model automatical (without human help) ? thanks in advance.
@user-hr5dc4ly3q
@user-hr5dc4ly3q 2 ай бұрын
you have very good knowledge in python and json so which books and websites was your reference to be master in python
@mr.nobody8079
@mr.nobody8079 3 жыл бұрын
flask and django both needs different model formats?........ plz explain........
@bingsenlim3121
@bingsenlim3121 2 жыл бұрын
just in case anyone here is using Windows, gunicorn does not work on windows. You'll get an error ModuleNotFound:fcntl because gunicorn uses fcntl. You can't run pip install fcntl on Windows because fcntl is only for Unix-based OS
@gbtech8602
@gbtech8602 2 жыл бұрын
@so beautiful memory Thank you, this help me
@owenlie
@owenlie 2 жыл бұрын
@so beautiful memory Thank you, this helps me.
@souvikbiswas284
@souvikbiswas284 Жыл бұрын
@so beautiful memory many thanks..
@alisonjmarch
@alisonjmarch 8 ай бұрын
@@sobeautifulmemory6170 Thank you, saved my life, was frustrated about it!!
@masoudrahimi3696
@masoudrahimi3696 9 ай бұрын
this toturial is great and I have watched until here. But, this one can be improved.
@aryankhatana
@aryankhatana 3 жыл бұрын
Can you do a video on deploying an RNN model using Flask, please?
@patloeber
@patloeber 3 жыл бұрын
My next videos will be about RNN
@alexnim4873
@alexnim4873 3 жыл бұрын
hi, you mentioned at the end that the normal torch and torchvision is too large for heroku, hence you had to select a smaller version. what can i do if i need the full version of torch and/or torchvision for my app on heroku? will paying for a heroku account fix this problem? I'm building a web app that uses BERT, an NLP library that is built off pytorch - but heroku is telling me that the in install exceeds the 500MB slug size. Or perhaps there is a lightweight version of BERT out there... i need to install "sentence-transformers==0.3.9" from my requirements.txt file Either way, thanks for the great video :) appreciate it
@RC-qi6hs
@RC-qi6hs 3 жыл бұрын
What did you do then, im also facing a similar situation. Thanks
@alexnim4873
@alexnim4873 3 жыл бұрын
@@RC-qi6hs hi, it's been a while since i worked on this. but i believe i installed the following version of torch and torch vision in my requirements.txt torch==1.6.0+cpu torchvision==0.7.0+cpu this means that these versions will only process your data using cpu resources this should be fine as inference does not really need a gpu to process the data unless you're processing exceptionally large amounts of data - in this case i'd move over to docker hope this helps!
@kyomdonalddogo5775
@kyomdonalddogo5775 3 жыл бұрын
Thank you sir for your video. Sir please can I ask you tips on how to deploy a seq2seq model using flask only? Thank you
@patloeber
@patloeber 3 жыл бұрын
thanks! I'll have a look into that
@kyomdonalddogo5775
@kyomdonalddogo5775 3 жыл бұрын
@@patloeber sir thank you for your response. I need your help sir. I have made pytorch models, but loading them to be used for production, I get errors. Sir please help me with this
@afdp3849
@afdp3849 Жыл бұрын
how about if the model is tranfer learning?
@ibobak
@ibobak Жыл бұрын
Thank you for a nice tutorial. But I can't understand one thing: why VSCode is so stupid that it doesn't see your typos? I am using PyCharm and it is highlighting them for me just immediately....
@IAmTheMainCharacter
@IAmTheMainCharacter 3 жыл бұрын
can you suggest some project? I have 8 months of time for one project.
@patloeber
@patloeber 3 жыл бұрын
Whatever interests you the most. I like object detection tasks where you learn more about CNNs. If you have enough time you can also build a nice frontend for your app.
@abhaytiwari6401
@abhaytiwari6401 3 жыл бұрын
Great Video Kind Sir, I want to make a movie recommendation app I get the data using tmdb API i want to take input from users like two or three movies they like and recommend similar movies using a ML Model Can you suggest few things 1. How should i proceed with this , Get a csv file from Tmdb api and get similar movies using collaborative filtering 2. which ML library i should use for this or which ML algorithm ?
@patloeber
@patloeber 3 жыл бұрын
great project! I suggest using either scikit-learn and testing different classifier, or PyTorch if you like to try Deep Learning
@souvikbiswas284
@souvikbiswas284 Жыл бұрын
i cannot use gunicorn on my windows PC. what is the alternative for that?? edited : you can use "waitress-serve" inplace of "gunicorn". you have to install waitress first
@alisonjmarch
@alisonjmarch 8 ай бұрын
What is the line you put inside Procfile? I am experiencing the same issue, and have waitress installed, however I cannot figure out the correct code format inside Procfile.
@giftchidi8774
@giftchidi8774 2 ай бұрын
@@alisonjmarch were you able to get past it
@1UniverseGames
@1UniverseGames 2 жыл бұрын
"Using backend: pytorch". How can I get rid of such thing when run python code, any help
@saurrav3801
@saurrav3801 3 жыл бұрын
Bro ....I search everywhere but I didn't get any satisfied result about ..how to implement KNN in pytorch.....
@patloeber
@patloeber 3 жыл бұрын
PyTorch main focus is on deep learning and neural nets, so for KNN other frameworks might be better suited. But you can implement it with tensors following my machine learning from scratch tutorial about KNN
@alisonjmarch
@alisonjmarch 8 ай бұрын
How do you run gunicorn on Windows System? I am lost after trying it on my Windows laptop and vscode and running heroku local won't work, it says 'gunicorn' is not recognized as an internal or external command, operable program or batch file.
@alisonjmarch
@alisonjmarch 8 ай бұрын
So what will be the correct line to add if using waitress instead of gunicorn in the Procfile?
@giftchidi8774
@giftchidi8774 2 ай бұрын
@@alisonjmarch having the same problem now. I'm completely stucked
@nobody2937
@nobody2937 2 жыл бұрын
```heroku login -i``` brought me : Error: Your account has MFA enabled; API requests using basic authentication with email and password are not supported. Please › generate an authorization token for API access. Any further suggestions?
@ikbalnayem8914
@ikbalnayem8914 3 жыл бұрын
"Process running mem=645M(126.0%) Error R14 (Memory quota exceeded)" Why my application does not release the resource on heroku? But in my local machine it does not consume much memory
@souvikbiswas284
@souvikbiswas284 Жыл бұрын
did you installed just the cpu only part for torch and torchvision??
@kimm8941
@kimm8941 2 жыл бұрын
34:00
@anounTT
@anounTT Жыл бұрын
oof, I enjoyed watching you troubleshoot. Too bad it was only typos. You don't see that in many tutorials.
@puneetwalia8641
@puneetwalia8641 10 ай бұрын
it isnt very much accurate with the paintbrush
@NobodyIikesyouduh
@NobodyIikesyouduh 2 жыл бұрын
This lecture is most confusing in the pytorch series due to many screen switches. I suggest to rerecord this by explaining the already written code.
@patloeber
@patloeber 2 жыл бұрын
thank you for the feedback! will try to improve this
@naknakn7807
@naknakn7807 3 жыл бұрын
you're so cute ;)
@patloeber
@patloeber 3 жыл бұрын
Thanks :)
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 57 МЛН
🌊Насколько Глубокий Океан ? #shorts
00:42
1 класс vs 11 класс  (игрушка)
00:30
БЕРТ
Рет қаралды 4,2 МЛН
Please be kind🙏
00:34
ISSEI / いっせい
Рет қаралды 129 МЛН
Deploying ML Models in Production: An Overview
14:27
Valerio Velardo - The Sound of AI
Рет қаралды 39 М.
Building a Machine Learning API in 15 Minutes | Coding Challenge
20:04
Nicholas Renotte
Рет қаралды 121 М.
Autoencoder In PyTorch - Theory & Implementation
30:00
Patrick Loeber
Рет қаралды 65 М.
How to Deploy a Flask App to Heroku | Flask Heroku Deployment
6:35
Arpan Neupane
Рет қаралды 47 М.
Build A Machine Learning Web App From Scratch
53:20
Patrick Loeber
Рет қаралды 198 М.
The OpenAI (Python) API | Introduction & Example Code
23:46
Shaw Talebi
Рет қаралды 21 М.
How I would learn Machine Learning (if I could start over)
7:43
AssemblyAI
Рет қаралды 740 М.
PyTorch Crash Course - Getting Started with Deep Learning
49:55
AssemblyAI
Рет қаралды 83 М.
We Got Expelled From Scholl After This...
00:10
Jojo Sim
Рет қаралды 57 МЛН