3

我正在尝试在 Google Colab 上运行 PyOpenPose

它需要CUDA,我就是这样做的。

!wget https://developer.nvidia.com/compute/cuda/10.0/Prod/local_installers/cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64 -O cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
!apt-key add /var/cuda-repo-10-0-local/7fa2af80.pub
!apt-get update
!apt-get install cuda

它需要 OpenCV3,我只是使用 -

!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python

为了解决一堆错误,我安装了其他几个包-

!apt-get install build-essential checkinstall pkg-config yasm
!apt-get install gfortran
!apt-get install libjpeg8-dev libjasper-dev libpng12-dev
!apt-get install libtiff5-dev
!apt-get install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
!apt-get install libxine2-dev libv4l-dev
!apt-get install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
!apt-get install qt5-default libgtk2.0-dev libtbb-dev
!apt-get install libatlas-base-dev
!apt-get install libfaac-dev libmp3lame-dev libtheora-dev
!apt-get install libvorbis-dev libxvidcore-dev
!apt-get install libopencore-amrnb-dev libopencore-amrwb-dev
!apt-get install x264 v4l-utils
!apt-get install libgoogle-glog-dev
!apt-get install libopencv-dev

然后我像这样安装了CuDNN -

!wget "http://developer.download.nvidia.com/compute/redist/cudnn/v5.1/cudnn-8.0-linux-x64-v5.1.tgz"
!tar -xvzf cudnn-8.0-linux-x64-v5.1.tgz
!cp cuda/include/cudnn.h /usr/local/cuda/include
!cp cuda/lib64/libcudnn* /usr/local/cuda/lib64
!chmod a+r /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
!dpkg -i libcudnn7_7.3.0.29-1+cuda10.0_amd64.deb
!apt-get install -f

然后我按照建议克隆了 OpenPose。改为目录。设置os.environ['OPENPOSE_ROOT'] = os.getcwd() 了一个构建目录。安装了cmake。然后尝试构建它,它有效。

!mkdir build
os.chdir("build")
!apt update
!apt install -y cmake
!cmake ..

接下来,我继续在 PyOpenPose 中创建了一个构建目录。尝试运行它,它说它需要 Boost 库。我使用这些命令安装了它 -

!apt-get install libboost-all-dev

我可以看到usr/lib/x86_64-linux-gnu(设置为os.environ['BOOST_LIBRARYDIR'])中存在的 boost 库

而 boost 位于/usr/include/boost(设置为os.environ['BOOST_ROOT']

经过所有这些努力,我在使用!cmake ..构建目录时遇到了这个错误:

cmake: /usr/local/lib/libcurl.so.4: no version information available 
(required by cmake)
Install prefix is set to: /usr/local
Generating with build type: Release
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE) 
-- Boost version: 1.65.1
CMake Warning at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1626     (message):
  No header defined for python2; skipping header check
Call Stack (most recent call first):
  CMakeLists.txt:61 (find_package)

CMake Error at /usr/share/cmake-3.10/Modules/FindBoost.cmake:1947 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.65.1

  Boost include path: /usr/include

  Could not find the following Boost libraries:

      boost_python2

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or     BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:61 (find_package)


-- The following REQUIRED packages have been found:
 * Threads
 * CUDA
 * OpenCV (required version >= 3)
 * PythonLibs (required version == 2.7)

-- The following OPTIONAL packages have not been found:
 * Doxygen

-- The following REQUIRED packages have not been found:
 * Boost

-- Configuring incomplete, errors occurred!
See also "/content/PyOpenPose/build/CMakeFiles/CMakeOutput.log".
See also "/content/PyOpenPose/build/CMakeFiles/CMakeError.log".

我的运行时是带有 GPU 的 Python3。我该如何解决这个问题,到目前为止一切都还好吗?

更新1: !cmake -D WITH_PYTHON3=True ..修复了。现在停留在检测 PythonLibs 上。

错误:

CMake Error at /usr/share/cmake-    3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find PythonLibs: Found unsuitable version "2.7.15rc1", but
  required is exact version "3" (found
  /usr/lib/x86_64-linux-gnu/libpython2.7.so)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:376     (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.10/Modules/FindPythonLibs.cmake:262     (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:72 (find_package)
4

0 回答 0