Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 1.43 KB

File metadata and controls

54 lines (37 loc) · 1.43 KB

PyTorch-MNIST-Tutorial

PyTorch MNIST 手写数字识别教程

Python 3.8+ PyTorch 1.9+ License MIT GitHub stars

Quick Start

1. Clone the repository

git clone https://github.com/KevinLikesCodingMC/PyTorch-MNIST-Tutorial.git

2. Install requirements

First download the MNIST dataset in CSV format and place mnist_train.csv and mnist_test.csv in the root directory:

PyTorch-MNIST-Tutorial/
├── LICENSE
├── model.pth
├── model.py
├── README.md
├── test.py
├── train.py
├── utils.py
├── demo.py
├── mnist_train.csv
└── mnist_test.csv

Then install these packages:

pip install numpy matplotlib pygame

3. Install PyTorch

Visit PyTorch official website.

4. Training and Testing

Run train.py to train and generate model model.pth.

Run test.py to test the model model.pth.

5. Visual Demo

Run demo.py to watch the visual demo.