How To Deploy ML Models With Google Cloud Run

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ค. 2024
  • Learn how to deploy Machine Learning / Deep Learning models with Google Cloud Run. We build a simple app with TensorFlow and Flask, containerize it with Docker, and deploy it to Google Cloud Run.
    Code and instructions: github.com/patrickloeber/ml-d...
    Get my Free NumPy Handbook:
    www.python-engineer.com/numpy...
    ✅ Write cleaner code with Sourcery, instant refactoring suggestions in VS Code & PyCharm: sourcery.ai/?... *
    ⭐ Join Our Discord : / discord
    📓 ML Notebooks available on Patreon:
    / patrickloeber
    If you enjoyed this video, please subscribe to the channel:
    ▶️ : / @patloeber
    ~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
    🖥️ Website: www.python-engineer.com
    🐦 Twitter - / patloeber
    ✉️ Newsletter - www.python-engineer.com/newsl...
    📸 Instagram - / patloeber
    🦾 Discord: / discord
    ▶️ Subscribe: / @patloeber
    ~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
    🅿 Patreon - / patrickloeber
    #Python
    Resources:
    cloud.google.com/sdk/docs/ins...
    cloud.google.com/run/docs/qui...
    sararobinson.dev/2020/08/18/m...
    TensorFlow course: • TensorFlow 2 Beginner ...
    PyTorch course: • PyTorch Tutorials - Co...
    Timeline:
    00:00 Introduction
    00:52 Prepare Model
    04:27 Write Flask App
    12:20 Setup Google Cloud Project
    12:59 Google Cloud SDK
    13:47 Dockerfile
    16:41 Deploy
    ----------------------------------------------------------------------------------------------------------
    * This is an affiliate 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! 🙏

ความคิดเห็น • 82

  • @patloeber
    @patloeber  3 ปีที่แล้ว +9

    What other deployment methods would you like to see?

    • @sakilahmed6788
      @sakilahmed6788 3 ปีที่แล้ว

      Is Google cloud service free to train model?

    • @anelm.5127
      @anelm.5127 3 ปีที่แล้ว +2

      AWS would be amazing

    • @rohanmehra3894
      @rohanmehra3894 3 ปีที่แล้ว +2

      Aws, Azure, docker, etc

    • @patloeber
      @patloeber  3 ปีที่แล้ว +1

      @@anelm.5127 thanks, yes will definitely do AWS

    • @patloeber
      @patloeber  3 ปีที่แล้ว +2

      @@sakilahmed6788 There is a free tier which is enough to play around with it

  • @nadillasyihaq5205
    @nadillasyihaq5205 2 ปีที่แล้ว

    Thank you very much sir. Your tutorial really helped me. I'm so glad I finally found a tutorial that worked for me 😁

  • @neo-the-one
    @neo-the-one 3 ปีที่แล้ว

    Great job as always man 👏 much appreciated, alot of people show how to create a ml app but not how to deploy it

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      glad you like it!

  • @rishiladdha
    @rishiladdha 7 หลายเดือนก่อน

    This was extremely helpful. Thank you so much!

  • @sambhawsharma8239
    @sambhawsharma8239 3 ปีที่แล้ว

    Thank you for your great videos, I have been using python for past 3 years but still didn't know many things, or using those things with knowing. I hope other would take advantage of these excellent tutorials, I will surely encourage my friends to watch and subscribe.

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      thanks! I also still don't know many things ;) you should never stop learning...

  • @yevg3907
    @yevg3907 3 ปีที่แล้ว

    Wow man I am glad I subscribed I was there when you just started and so much proper content since then it’s amazing! Thank you so much for all this!!!!! Great stuff !!!!

    • @patloeber
      @patloeber  3 ปีที่แล้ว +1

      Happy to hear that :) Thanks so much for your support!

    • @yevguyduy329
      @yevguyduy329 3 ปีที่แล้ว

      @@patloeber Would it be possible to do one with app engine?

  • @petricaradan3752
    @petricaradan3752 2 ปีที่แล้ว

    Hello!
    Thanks for this great tutorial. I have one question. We need to install docker in our computer to deploy the model on gcp?

  • @placidnick100
    @placidnick100 ปีที่แล้ว +1

    It works for the first time but throws error on 2nd deploy:
    Revision 'getprediction-00002-ved' is not ready and cannot serve traffic. The user-provided container
    failed to start and listen on the port defined provided by the PORT=8080 environment variable.

  • @ajinkyabankar8036
    @ajinkyabankar8036 ปีที่แล้ว +1

    Thanks for a great video. In addition to the video content, can you build a simple webapp using Dash and show the demonstration? Preferably, the end user can upload the image in the webapp and see the classification result. That will be cool!

  • @maduresenerd5716
    @maduresenerd5716 ปีที่แล้ว

    thanks bro, you helped me a lot

  • @huijokim3342
    @huijokim3342 10 หลายเดือนก่อน +2

    Any way to use GPU for the heavy computation model?

  • @husk1188
    @husk1188 ปีที่แล้ว

    great demo!

  • @user-go3gp7lp6o
    @user-go3gp7lp6o ปีที่แล้ว

    here you only had one "method" - index, what if i have multiple? do i have to do gcloud build multiple times?

  • @quangninh8904
    @quangninh8904 ปีที่แล้ว

    how i can fix this error
    The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.

  • @brentsimpson3791
    @brentsimpson3791 3 หลายเดือนก่อน

    Awesome thank you.

  • @lexx-dat
    @lexx-dat 4 หลายเดือนก่อน

    How can I do if I want an esp32-cam to send the video live to the model deployed in Google Cloud?

  • @peterjohngerero150
    @peterjohngerero150 ปีที่แล้ว

    I run a FastAPI ML for an android app. I did your process but it runs into an error said "Internal Server Error", what's the problem with this?

  • @shadwar123
    @shadwar123 5 หลายเดือนก่อน

    @patloeber Hi , I am getting CORS error after deploying a Sequential model using Keras, ML model when i am using it in my react app . Can you please help me. In Model I have different layers like embeding layer, Lstm layer etc.

  • @rafaellauxen3577
    @rafaellauxen3577 3 ปีที่แล้ว

    Nice tutorial, thank you!

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      Glad it was helpful!

  • @ug1880
    @ug1880 10 หลายเดือนก่อน

    I want to deploy a small application for Machine Learning. It is using BigQuery. Volume of data is medium high.
    I want a CICD pipeline.
    The application is only for business users. What service should I use for deployment on google cloud ?

  • @-YogiDwiAndrian
    @-YogiDwiAndrian 3 ปีที่แล้ว

    How code request from android studio to get prediction?

  • @martinalarconcarbajal417
    @martinalarconcarbajal417 ปีที่แล้ว

    Is it posible to use fastapi on google cloud run?

  • @jaggyjut
    @jaggyjut 3 ปีที่แล้ว

    Just finished learning ML and was looking how to deploy. Awesome

    • @gilbertlopez
      @gilbertlopez 3 ปีที่แล้ว

      where did you learn?

    • @patloeber
      @patloeber  3 ปีที่แล้ว +2

      You're never done with learning ML ;) But congrats! Hope you'll enjoy the video

    • @jaggyjut
      @jaggyjut 3 ปีที่แล้ว

      @@patloeber true. The basics i guess. Thanks for the tutorial. Really appreciate.

    • @jaggyjut
      @jaggyjut 3 ปีที่แล้ว +1

      @@gilbertlopez udemy data science course by Jose Portilla. the good thing about this course is it covers the basic maths theory, example and then exercise.

    • @gilbertlopez
      @gilbertlopez 3 ปีที่แล้ว

      @@jaggyjut awesome thanks for the recommendation!

  • @elpapachelegendario8330
    @elpapachelegendario8330 3 ปีที่แล้ว

    gracias por todo el conocimiento dado.

  • @Alecor_studio
    @Alecor_studio 3 ปีที่แล้ว +4

    Can`t wait for this! Also will you do kubernetes in future some time too ?

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      Great suggestion! I will have to look into this...

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 3 ปีที่แล้ว

    another great topic!

  • @bcg3507
    @bcg3507 2 หลายเดือนก่อน

    Your video Literally saved my ass ...Dankeschon

  • @leamon9024
    @leamon9024 2 หลายเดือนก่อน

    Does Cloud Run support GPU now?

  • @sakaar-lok9109
    @sakaar-lok9109 ปีที่แล้ว

    love you! can we deploy tf2 models without docker and just using app engine

  • @fluttydev3157
    @fluttydev3157 2 ปีที่แล้ว

    Best 👍👍👍 one

  • @tamirtsogbayar3912
    @tamirtsogbayar3912 3 ปีที่แล้ว

    Awesome

  • @user-pc7kr6vt6o
    @user-pc7kr6vt6o 3 ปีที่แล้ว

    Could you tell me font or thema using in your pycharm? look so good!

    • @patloeber
      @patloeber  3 ปีที่แล้ว +1

      It's the Dracula Theme

  • @loosoonchin6469
    @loosoonchin6469 3 ปีที่แล้ว

    import requests
    resp = requests.post("127.0.0.1:5000/", files={'file': open('three.png', 'rb')})
    print(resp.json())
    Output:
    Traceback (most recent call last):
    File "d:\Self Learning- Tutorial\Python-PE Advance PYthon\GoogleCloudML_Deployment\test\test.py", line 3, in
    resp = requests.post("127.0.0.1:5000/", files={'file': open('three.png', 'rb')})
    FileNotFoundError: [Errno 2] No such file or directory: 'three.png'
    I did have three.png, why is it not running the prediction function here? I stopped main.py and run test.py.
    Do I have to run the main.py at the same time? btw I am using VS code.

  • @ShahJr
    @ShahJr 3 ปีที่แล้ว

    Exciting stuff but this requires billing to be enabled right?

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      Yes I think you need to enable it, but there is a free tier to play around with it

  • @mr.gadgethd4203
    @mr.gadgethd4203 2 ปีที่แล้ว

    Special thank for making tutorial on Deploy ML Models With Google Cloud Run. However, could you/everyone assist me on the next step that I want to implement "test.py" in HTML. I mean that I want to run resquests.post with my serviceURL from GCP in another index.html. Hope to receive help from everyone. Thank you so much in advance.

  • @ArunKumar-sg6jf
    @ArunKumar-sg6jf 3 ปีที่แล้ว

    we have to enable billing for this yes or no Bro

    • @patloeber
      @patloeber  3 ปีที่แล้ว +2

      Yes I think you need to enable it, but there is a free tier to play around with it

  • @user-go3gp7lp6o
    @user-go3gp7lp6o ปีที่แล้ว

    Anyone face this issue? Gcloud is not recognised as an internal or external command

  • @antoniodejesuscamposrodrig5250
    @antoniodejesuscamposrodrig5250 2 ปีที่แล้ว

    What Tensorflow version are you using?

  •  3 ปีที่แล้ว

    Perfect example man, but is possible use GPU with GCP cloud run ?

    • @patloeber
      @patloeber  3 ปีที่แล้ว

      yes it's possible, but not for free of course

    • @ml-engineer
      @ml-engineer 2 ปีที่แล้ว +1

      @@patloeber There is no direct support for GPUs with Cloud run. You can do it with Cloud Run for Anthos, but for that, you again need a Kubernetes Cluster somewhere.

  • @user-or7ji5hv8y
    @user-or7ji5hv8y 3 ปีที่แล้ว +1

    Did anybody else get this error?
    ERROR: (gcloud.run.deploy) Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.

    • @placidnick100
      @placidnick100 ปีที่แล้ว

      yes, first run it worked but 2nd deploy I saw the error, any clue how to fix it?

  • @anogboy3297
    @anogboy3297 3 ปีที่แล้ว

    Great

  • @vigneshvlk4928
    @vigneshvlk4928 3 ปีที่แล้ว

    In pycharm

  • @vigneshvlk4928
    @vigneshvlk4928 3 ปีที่แล้ว

    You will useing Linux

  • @FanaticAuthorship
    @FanaticAuthorship ปีที่แล้ว +1

    total fraud, your thumbnail said app deployement.