Spaces:
Running
on
Zero
Running
on
Zero
Online learning example on MNIST dataset
Overview
The example presents a simple Online Learning concept based on MNIST dataset. There are two models: inference and training and both are deployed on Triton Inference Server. Inference model is used for inference requests and training model is used for training. Inference model is replaced with training model after each training epoch.
Example consists of following scripts:
install.sh
- install additional dependenciesserver.py
- start the model with Triton Inference Serverclient_infer.py
- execute HTTP/gRPC requests to the deployed modelclient_train.py
- execute HTTP/gRPC requests to the deployed model for trainingmodel.py
- model definition
Quick Start
The step-by-step guide:
- Install
pytriton
following the installation instruction - Install the additional packages using
install.sh
./install.sh
- In current terminal start the model on Triton using
server.py
./server.py
- Open new terminal tab (ex.
Ctrl + T
on Ubuntu) or window - Go to the example directory
- Run the
client_infer.py
to perform inference requests (with test dataset) on the deployed model and calculate accuracy. At the beginning accuracy should be around 10% (random predictions). In the next steps you will run the training, so after a while accuracy should increase.
./client_infer.py
- Open new terminal tab (ex.
Ctrl + T
on Ubuntu) or window - Go to the example directory
- Run the
client_train.py
to perform training inference with training dataset on the training model (The script communicates epoch number). The inference model will be replaced with training model after each epoch, so in the ./client_infer.py terminal you should see the accuracy increasing.
./client_train.py