iamhankai / cpp-pytorch

A bite of cpp api in PyTorch-1.0
165 stars 40 forks source link

build error #7

Open yjhjstz opened 5 years ago

yjhjstz commented 5 years ago

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>
iamhankai commented 5 years ago

please provide the correct path of libtorch

wsqat commented 5 years ago

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

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

iamhankai commented 5 years ago

include "torch/Tensor.h"

Tyr like this?

Evoluange commented 4 years ago

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

GeLink9999 commented 3 years ago

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