This is our simple REST API running on Flask.
Before you can running this server.py
you need to provide the following:
- Virtual Machine on GCP (make sure open the port 8080, and have correct permission for Cloud Storage)
- Git, for cloning the repository
- pip, for installing python module
- ML Model that already trained
Run the command below step by step to make sure you're on the right track.
- Update your system package manager (in this case we're using
apt
) and then installed important programs.
sudo apt update && sudo apt install -y git python3-pip screen
- Update pip so we can install the newest tensorflow
pip3 install pip --upgrade
- Clone this repo
git clone https://github.com/herblabsai/herbify-deploy-model.git
- Change dir to herbify-deploy-model and then install important modules
cd herbify-deploy-model
pip3 install -r requirements.txt
in case you're getting error like MemoryError when installing tensorflow, please use the following command instead
pip3 install --no-cache-dir -r requirements.txt
- Download our ML model here, and save them in herbify-deploy-model directory
- Run the command via screen command, so you can leave the terminal safely
screen -S herbify python3 server.py
- When running the
server.py
you got this error, (Error :
ImportError: libGL.so.1: cannot open shared object file: No such file or directory). Please install the following library from your system package manager
sudo apt install ffmpeg libsm6 libxext6 -y