fbtorch:cmake找不到火炬目录 [英] fbtorch: cmake can not find torch directories

查看:322
本文介绍了fbtorch:cmake找不到火炬目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建和安装fbtorch,但是当我使用cmake时出现以下错误:

I am trying to build and install fbtorch, however when I used cmake I got the following error:

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.

我在网上搜索并找到了一些解决方案,例如使用

I searched online and found some solutions such as using

source ~/torch/install/bin/torch-activate

或重新安装割炬,但无济于事。
有人可以帮我吗?谢谢。

or reinstalling torch, but nothing helps. Could someone help me? Thank you.

推荐答案

如果使用clion:


clion首选项->环境---> / some_path_to / torchscript / libtorch / share / cmake / Torch

clion preference --> Environment ---> /some_path_to/torchscript/libtorch/share/cmake/Torch

这篇关于fbtorch:cmake找不到火炬目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆