Skip to content

MakGulati/simple_pytorch_cpp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Boilerplate Transfer Learning Example for running pytorch C++ distribution


Installing libtorch

At first, C++ distribution of pytorch needs to be installed mentioned in the link.

wget https://download.pytorch.org/libtorch/nightly/cpu/libtorch-shared-with-deps-latest.zip
unzip libtorch-shared-with-deps-latest.zip
rm -rf libtorch-shared-with-deps-latest.zip

Building application using cmake

mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=/absolute/path/to/libtorch ..
cmake --build . --config Release

Executing the compiled code from build directory

./simple_pytorch_cpp ../models/py_trace_model.pt 

About

contains simple torch cpp examples.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published