Caffe2:安装密集姿势时,make ops失败

时间:2018-10-01 14:57:23

标签: caffe2

我正在尝试安装here,但是在执行make ops时遇到问题。

首先我得到未发现错误Caffe2Config.cmake,但是按照此处DensePose的说明进行操作后,Caffe2Config.cmake最终位于build目录下。

将路径添加到build文件夹中会出现以下错误:

  CMake Error at /home/erikbylow/Code/LocalLibs/pytorch/build/Caffe2Config.cmake:14 (include):
  include could not find load file:

    /home/erikbylow/Code/LocalLibs/pytorch/build/public/utils.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)


CMake Error at /home/erikbylow/Code/LocalLibs/pytorch/build/Caffe2Config.cmake:17 (include):
  include could not find load file:

    /home/erikbylow/Code/LocalLibs/pytorch/build/public/threads.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)


CMake Error at /home/erikbylow/Code/LocalLibs/pytorch/build/Caffe2Config.cmake:88 (include):
  include could not find load file:

    /home/erikbylow/Code/LocalLibs/pytorch/build/public/cuda.cmake
Call Stack (most recent call first):
  CMakeLists.txt:8 (find_package)

由于请求的cmake-文件位于pytorch/cmake/public下而不是pytorch/build/public下,因此路径显然是错误的。

如何解决这个问题?我刚刚按照指示进行了测试,并进行了测试。似乎是Caffe2的安装导致了问题?

1 个答案:

答案 0 :(得分:0)

就我而言,将环境变量Caffe2_DIR设置为丢失文件的目录即可解决问题。

如前所述,这些文件位于pytorch/cmake/public目录中,而不是pytorch/build/public中。要手动定义Caffe2的路径,请在densitypose文件夹中打开CMakeLists.txt,并在开头添加一行:

set(Caffe2_DIR "/home/erikbylow/Code/LocalLibs/pytorch/cmake/")

再次运行make ops,此问题应得到解决。如果没有,也尝试

set(Caffe2_DIR "/home/erikbylow/Code/LocalLibs/pytorch/torch/share/cmake/Caffe2/")

此外,在成功安装DensePose之后,请记住将其路径附加到PYTHONPATH:

export PYTHONPATH=$PYTHONPATH:/path/to/densepose/