我正在尝试构建并安装 fbtorch,但是当我使用 cmake 时出现以下错误:
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.
我在网上搜索并找到了一些解决方案,例如使用
source ~/torch/install/bin/torch-activate
或重新安装火炬,但没有任何帮助。
有人可以帮助我吗?谢谢。
遇到同样的问题。
解决方案:导出Torch_DIR
作为 cmake 之前的环境变量
例如我在 Linux 上使用 python 虚拟环境,并使用“pip”安装了 pytorch。
export Torch_DIR=/home/my/pyenv/py3.7-torch1.0/lib/python3.7/site-packages/torch/share/cmake/Torch
cmake blablabla
make
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)