CMake Error at CMakeLists.txt:9 (FIND_PACKAGE):
By not providing "FindTorch.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Torch", but
CMake did not find one.
Could not find a package configuration file provided by "Torch" with any of
the following names:
TorchConfig.cmake
torch-config.cmake
Add the installation prefix of "Torch" to CMAKE_PREFIX_PATH or set
"Torch_DIR" to a directory containing one of the above files. If "Torch"
provides a separate development package or SDK, be sure it has been
installed.
解决:
export Torch_DIR="TorchConfig.cmake torch-config.cmake的绝对路径"
比如:export Torch_DIR=/home/mzq/.local/lib/python3.8/site-ackages/torch/share/cmake
然后进行编译
cmake -DCMAKE_PREFIX_PATH="your libtorch path" ..
make -j4
88

被折叠的 条评论
为什么被折叠?



