How to Deploy YOLOv8 Model in Python Flask Backend on Heroku with Large Model Files? #17025
Unanswered
cabral0413
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I developed a mobile app for image detection and classification using a Python Flask backend and React Native frontend. I trained my YOLOv8 model using Google Colab and downloaded the best.pt and bestc.pt files for object detection and classification. I placed these model files in the backend folder (/backend/models/) of my Flask app.
I’m trying to deploy the backend on Heroku, but I’m running into issues because the file size of the models is large. When I try to deploy the app on Heroku, I get an error saying that it can't detect the ultralytics package. After installing ultralytics, the size of my application increases to 3GB, which exceeds the 500MB limit allowed in the free version of Heroku.
Without the models and ultralytics package, the backend size is just 10MB. Here's my folder structure for the backend:
My Question:
How can I deploy this Flask app on Heroku with a large model size (around 3GB) while staying under Heroku's free tier limit of 500MB?
Are there any best practices for managing large models when deploying on Heroku or any alternative cloud solutions for this problem?
Beta Was this translation helpful? Give feedback.
All reactions