https://github.com/krshrimali/digit-recognition-mnist-svhn-pytorch-cpp
Implementing CNN for Digit Recognition (MNIST and SVHN dataset) using PyTorch C++ API
https://github.com/krshrimali/digit-recognition-mnist-svhn-pytorch-cpp
cnn computer-vision cpp deeplearning digit-recognition libtorch mnist mnist-dataset pytorch
Last synced: 3 months ago
JSON representation
Implementing CNN for Digit Recognition (MNIST and SVHN dataset) using PyTorch C++ API
- Host: GitHub
- URL: https://github.com/krshrimali/digit-recognition-mnist-svhn-pytorch-cpp
- Owner: krshrimali
- License: mit
- Created: 2019-06-01T02:44:17.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-08T16:05:29.000Z (over 3 years ago)
- Last Synced: 2025-06-09T00:05:10.417Z (4 months ago)
- Topics: cnn, computer-vision, cpp, deeplearning, digit-recognition, libtorch, mnist, mnist-dataset, pytorch
- Language: C++
- Homepage: https://krshrimali.github.io/PyTorch-C++-API/
- Size: 14.6 KB
- Stars: 24
- Watchers: 3
- Forks: 10
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Digit-Recognition-MNIST-SVHN
## Blog
The blog post on using VGG-Net on MNIST Dataset using PyTorch C++ API: https://krshrimali.github.io/posts/2019/06/introduction-to-pytorch-c-api-mnist-digit-recognition-using-vgg-16-network/.
## Implementing CNN for Digit Recognition (MNIST and SVHN dataset) using PyTorch C++ API
**Branch - Version 1**
1. Using MNIST dataset currently.
2. Installing PyTorch C++ API.
3. Training using PyTorch C++ API.**Note**: There may be C10:errors either because of:
1. Incorrect data path. Check your data directory of MNIST dataset.
2. Make sure while using `cmake`: `cmake -DCMAKE_PREFIX_PATH=/absolute_path_to_libtorch/` - it should be absolute path to `libtorch.`## Process
Note: Prefer using stable version of libtorch. This code doesn't use GPU, as I don't have the resources to test it right now.
1. `mkdir build`
2. `cd build`
3. cmake: `cmake -DCMAKE_PREFIX_PATH=/home/user/path/to/libtorch/ ..`
4. `make`
5. `./example`