Here we have used docker compose to train, evaluate and inference the MNIST dataset. We have used a shared volume named mnist
to share the data between the containers. The data is downloaded from the internet and saved in the data
directory inside it.
We have used PyTorch to train the model. The model is trained on the MNIST dataset and the trained model is saved in the models
directory. The trained model is then used to evaluate the model on the test dataset and the accuracy matric is saved in eval_results.json
file. The trained model is also used to inference the model on the test dataset and the inference results are saved in the results
directory in mnist volume. Model code is also shared between the containers. Steps to run the training, evaluation and inference are given below:
Follow the instructions on the Docker website to install Docker on your machine.
Follow the instructions on the Docker website to install Docker Compose on your machine.
Clone the repository to your local machine using the following command:
git clone repo link
Build the Docker images using the following command:
docker-compose build
To run the training Docker container, use the following command:
docker-compose run train
To run the evaluation Docker container, use the following command:
docker-compose run evaluate
To run the inference Docker container, use the following command:
docker-compose run infer