Mihail_DM
(Mihail Dm)
December 25, 2018, 2:18pm
1
Till now, I just downloaded the LibTorch from here https://download.pytorch.org/libtorch/cpu/libtorch-win-shared-with-deps-latest.zip
I tried to include it to my Visual Studio application project, but I still get errors with “file not found”.
Also, I need to have installed PyTorch 1.0 in Windows ? I downloaded the model.pt from Kaggle Kernels.
I need a complete tutorial with how I install/include LibTorch in Visual Studio.
1 Like
It will be easier if you use CMake. If you stick to building the project using VS, then instead of dragging the directory of libtorch to your project, you should add the include directory(should be in Project settings/C++) and the libraries (should be in Project settings/Linker) in the project settings.
Song_Zhu
(Song Zhu)
January 17, 2019, 4:13pm
4
Could you please tell some details? Which directory should be added to settings/C++? And, which libraries should be added to settings/Linker?
Thanks!
peterjc123:
It will be easier if you use CMake. If you stick to building the project using VS, then instead of dragging the directory of libtorch to your project, you should add the include directory(should be in Project settings/C++) and the libraries (should be in Project settings/Linker) in the project settings.
Hi,
Could you please help me resolve issues I’m facing while trying to compile a simple cpp+libtorch code in VS 2017 on Windows:
Hello,
Here’s my simple cpp code that just loads the model. I’m trying to compile this code in Windows 7, VS 2017. I’ve included path to libtorch/include to C++ include dirs & libtorch/lib to linker
#define _CRT_SECURE_NO_WARNINGS
#include "torch/script.h"
#include <iostream>
#include <memory>
#include <fstream>
#include <stdint.h>
#include <vector>
typedef unsigned char BYTE;
using namespace std;
int main(int argc, const char* argv[]) {
if (argc != 3) {
std::cerr << "usage: example-app &…
Thanks a lot!
msminhas93
(Manpreet Singh)
October 13, 2020, 11:46pm
7
I’ve written a tutorial on how to setup visual studio 2019 project using libtorch 1.6 https://expoundai.wordpress.com/2020/10/13/setting-up-a-cpp-project-in-visual-studio-2019-with-libtorch-1-6/
The concept should be similar for other versions also.