This repo contains a sample code to show how to create a cnn model using pytorch and trained on the mnist.
Install pytorch
and other necessary module (tensorboard
and matplotlib
).
pip install -r requirements.txt
Run train.py to train your cnn model on mnist dataset.
python train.py
Run test.py to test the trained model on your own handwritten digit.
python test.py
- register an account of heruku
- create an
app
on heruku - push the
deploy
folder to heroku master
Learn more about training, read the following article written in Chinese
https://github.com/avinassh/pytorch-flask-api-heroku
https://pytorch.org/tutorials/beginner/blitz/cifar10_tutorial.html