cpp-pytorch
cpp-pytorch copied to clipboard
A bite of cpp api in PyTorch-1.0
$ ./example-app ../model.pt ../dog.png ../synset_words.txt load model ok execution time = 4.47019s Segmentation fault: 11 Can anyone help me out? Thanks
> cmake -DCMAKE_PREFIX_PATH=$PWD/../libtorch .. got error: ```shell [ 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 ```
转换到非标量
/Python2C++/main.cpp:18:107: 错误:请求从‘torch::jit::script::Module’转换到非标量类型‘std::shared_ptr’ 有人遇到这种问题吗 std::shared_ptr module = torch::jit::load("/model.pt");
Hi, @iamhankai I met this error when cmake. Kerb:build Apple$ cmake -DCMAKE_PREFIX_PATH=~/libtorch CMakeLists.txt .. -- The C compiler identification is AppleClang 10.0.1.10010046 -- The CXX compiler identification is AppleClang 10.0.1.10010046...
When I run the forward prediction, the C++ run time is much longer than python, has someone encountered this problem?
i can run 'camke ..' successfully, but when i run 'make', it shows : /home/workplace/cpp-pytorch/example-app.cpp:44:49: error: ‘class at::DeprecatedTypeProperties’ has no member named ‘tensorFromBlob’ auto img_tensor = torch::CPU(torch::kFloat32).tensorFromBlob(img_float.data, {1, 224, 224,...

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Magic number mismatch in PyTorch file. File may be corrupted or is not actually a PyTorch file. Abort trap: 6
I print the results of image preprocessing, and they are a little different.