iamhankai / cpp-pytorch

A bite of cpp api in PyTorch-1.0

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

build error

yjhjstz opened this issue · comments

cmake -DCMAKE_PREFIX_PATH=$PWD/../libtorch ..

got error:

[ 50%] Building CXX object CMakeFiles/example-app.dir/example-app.cpp.o
/home/luban/cpp-pytorch/example-app.cpp:3:27: fatal error: torch/Tensor.h: No such file or directory
 #include <torch/Tensor.h>

please provide the correct path of libtorch

@yjhjstz @iamhankai @1343464520 怎么解决/data/2019-06/libtorch/cpp-pytorch/example-app.cpp:3:27: fatal error: torch/Tensor.h: 没有那个文件或目录
此问题?

我的libtorch path没有问题
请教一下,谢谢!

#include "torch/Tensor.h"

Tyr like this?

在CMakeLists.txt里把GCC改成14,再把#include <torch/Tensor.h> 注掉就行了

commented

改成:#include<ATen/core/Tensor.h>