Introduction to PyTorch C++ API: MNIST Digit Recognition using VGG-16 Network

Environment Setup [Ubuntu 16.04, 18.04] Note: If you have already finished installing PyTorch C++ API, please skip this section. Download libtorch: CPU Version: wget https://download.pytorch.org/libtorch/cpu/libtorch-shared-with-deps-latest.zip -O libtorch.zip GPU Version (CUDA 9.0): wget https://download.pytorch.org/libtorch/cu90/libtorch-shared-with-deps-latest.zip -O libtorch.zip GPU Version (CUDA 10.0): wget https://download.pytorch.org/libtorch/cu100/libtorch-shared-with-deps-latest.zip Unzip libtorch.zip: unzip libtorch.zip We’ll use the absolute path of extracted directory (libtorch) later on. Implementation The VGG-16 Network is shown in the Figure below. We’ll start of by first including libtorch header file. ...

June 7, 2019 · 3 min · Kushashwa Ravi Shrimali