Giter Club home page Giter Club logo

ml-facebokeh-project's Introduction

Deploying Face Emotion on Nvidia Triton Server with MLFlow

๐Ÿ“š Learning Objectives

By the end of this session, you will be able to:

  • Train and Deploy a Model using AWS EC2 GPU instance
  • Track Experiments within ML Flow

Deployment on EC2

Create EC2 Instance

Install dependencies

  • Get the ip address of the instance
  • Change key permissions to 400 (chmod 400 key.pem)
  • SSH into the machine ssh -i key.pem [email protected]
  • Install git if needed (sudo apt install git for ubuntu based distros, sudo yum install git for amazon linux)
  • Install Docker (sudo apt install docker for ubuntu based distros, sudo yum install docker for amazon linux)
  • Start Docker (sudo systemctl start docker)
  • Add user to docker group (sudo usermod -aG docker ${USER})
  • Logout and Login again through SSH to take the group changes into account
  • Check if docker installed correctly (docker run hello-world)
  • Install Docker-Compose
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose version
  • Install the requirements (pip install -r requirements.txt) the pip and python version might be different
  • Create data directory (mkdir data)
  • Download and uncompress the training data in the data folder
wget https://www.robots.ox.ac.uk/~vgg/data/pets/data/images.tar.gz
wget https://www.robots.ox.ac.uk/~vgg/data/pets/data/annotations.tar.gz
tar -xzf images.tar.gz
tar -xzf annotations.tar.gz
  • Train the model (python train.py)
  • Run ml-flow ui (mlflow ui --port 8004 --host 0.0.0.0)
  • Configure awscli (aws configure)
  • Upload the model to the s3 model repository
aws s3 cp --recursive segmentation s3://triton-repository/models/pet-bokeh/1/model.savedmodel/
  • Upload the config
aws s3 cp pet-bokeh/config.pbtxt s3://triton-repository/models/pet-bokeh/config.pbtxt

Docker Compose

  • Add triton to the docker-compose.yaml with image, env file, ports and command.
  • Run all the endpoints and triton server (docker-compose -f docker-compose.yaml up --build)
  • Create a request with docs (http://ec2.ip.address:8000/docs)

ml-facebokeh-project's People

Contributors

narenb7 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.