0

我正在尝试安装DensePose但在执行时遇到问题make ops

首先我得到错误Caffe2Config.cmake未找到,但是按照这里的说明Caffe2 build from source最终Caffe2Config.cmakebuild目录下。

将路径添加到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那个导致的问题?

4

1 回答 1

0

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

正如您所提到的,这些文件位于pytorch/cmake/public目录中,而不是pytorch/build/public. 要手动定义Caffe2的路径,打开CMakeLists.txtdensepose文件夹中的,在开头添加一行:

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/
于 2018-11-15T07:16:06.073 回答