Denbergvanthijs/PyTorchCPPWithTorchVisionCPP

PyTorch / libtorch c++ 1.8 with TorchVision 0.9

★ 0Forks 0C++GitHub ↗Compare

README

PyTorch C++ with torchvision C++

Follow the steps outlined here https://pytorch.org/tutorials/advanced/cpp_frontend.html

Make sure Libtorch is version 1.8 and Torchvision is version 0.9.

Install libtorch

cd ~
wget https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-1.8.1%2Bcpu.zip
unzip libtorch-win-shared-with-deps-1.8.1%2Bcpu.zip

Install TorchVision

cd ~
git clone https://github.com/pytorch/vision.git
git checkout release/0.9

mkdir build
cd build
sudo cmake .. -DCMAKE_PREFIX_PATH=~/libtorch

// Need to update cmake?
// Follow: https://askubuntu.com/a/829311

make
sudo make install

Build this repository

cmake -DCMAKE_PREFIX_PATH=~/libtorch
cmake -DCMAKE_PREFIX_PATH=~/libtorch  // Run this command twice
cmake --build . --config Release
./ImportNetwork

References:

Contributors

venkatacrcDenbergvanthijs

Issues