在Colab上安装openpose

时间:2020-06-25 19:59:02

标签: jupyter-notebook google-colaboratory openpose

我一直在尝试使用以下脚本在Google colab上安装openpose。

import os
from os.path import exists, join, basename, splitext

git_repo_url = 'https://github.com/CMU-Perceptual-Computing-Lab/openpose.git'
project_name = splitext(basename(git_repo_url))[0]
if not exists(project_name):
  # see: https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/949
  # install new CMake becaue of CUDA10
  !wget -q https://cmake.org/files/v3.13/cmake-3.13.0-Linux-x86_64.tar.gz
  !tar xfz cmake-3.13.0-Linux-x86_64.tar.gz --strip-components=1 -C /usr/local
  # clone openpose
  !git clone -q --depth 1 $git_repo_url
  !sed -i 's/execute_process(COMMAND git checkout master WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\/3rdparty\/caffe)/execute_process(COMMAND git checkout f019d0dfe86f49d1140961f8c7dec22130c83154 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}\/3rdparty\/caffe)/g' openpose/CMakeLists.txt
  # install system dependencies
  !apt-get -qq install -y libatlas-base-dev libprotobuf-dev libleveldb-dev libsnappy-dev libhdf5-serial-dev protobuf-compiler libgflags-dev libgoogle-glog-dev liblmdb-dev opencl-headers ocl-icd-opencl-dev libviennacl-dev
  # install python dependencies
  !pip install -q youtube-dl
  # build openpose
  !cd openpose && rm -rf build || true && mkdir build && cd build && cmake .. && make -j`nproc`

这是该colab笔记本Link to colab notebook的链接。在那里工作得很好。但是,当我在自己的colab笔记本上尝试相同的脚本时,会出现以下错误。

[ 82%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/io.cpp.o
[ 82%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/math_functions.cpp.o
[ 83%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/signal_handler.cpp.o
[ 83%] Building CXX object src/caffe/CMakeFiles/caffe.dir/util/upgrade_proto.cpp.o
[ 84%] Linking CXX shared library ../../lib/libcaffe.so
CMake Error: failed to create symbolic link '../../lib/libcaffe.so': operation not supported on socket
CMake Error: cmake_symlink_library: System Error: Operation not supported
src/caffe/CMakeFiles/caffe.dir/build.make:2215: recipe for target 'lib/libcaffe.so.1.0.0' failed
make[5]: *** [lib/libcaffe.so.1.0.0] Error 1
make[5]: *** Deleting file 'lib/libcaffe.so.1.0.0'
CMakeFiles/Makefile2:240: recipe for target 'src/caffe/CMakeFiles/caffe.dir/all' failed
make[4]: *** [src/caffe/CMakeFiles/caffe.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make[3]: *** [all] Error 2
CMakeFiles/openpose_lib.dir/build.make:110: recipe for target 'caffe/src/openpose_lib-stamp/openpose_lib-build' failed
make[2]: *** [caffe/src/openpose_lib-stamp/openpose_lib-build] Error 2
CMakeFiles/Makefile2:72: recipe for target 'CMakeFiles/openpose_lib.dir/all' failed
make[1]: *** [CMakeFiles/openpose_lib.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

不知道为什么会出现此错误。

CMake Error: failed to create symbolic link '../../lib/libcaffe.so':       operation not supported on socket

任何帮助将不胜感激。预先感谢。

1 个答案:

答案 0 :(得分:0)

可能存在cmake,CUDA和cuDNN的某些版本问题。检查兼容性。