CMU-Perceptual-Computing-Lab / openpose

OpenPose: Real-time multi-person keypoint detection library for body, face, hands, and foot estimation
https://cmu-perceptual-computing-lab.github.io/openpose
Other
31.41k stars 7.88k forks source link

Python API #2156

Open mobeeniqbal101 opened 2 years ago

mobeeniqbal101 commented 2 years ago

Hi, I am trying to run some python examples, but I am unable to do so. I checked Build python while doing the Cmake-configuration and I can also see the following folder, but whenever I try to run I get the following error stating "cannot import pyopenpose"

Executed Command (if any)

Note: add --logging_level 0 --disable_multi_thread to get higher debug information.

python2 01_body_from_image.py --logging_level 0 --disable_multi_thread

OpenPose Output (if any)

image

Errors (if any)

Error: OpenPose library could not be found. Did you enable BUILD_PYTHON in CMake and have this Python script in the right folder? cannot import name pyopenpose

Type of Issue

Select the topic(s) on your post, delete the rest:

Your System Configuration

  1. Whole console output (if errors appeared), paste the error to PasteBin and then paste the link here: LINK

  2. OpenPose version: Latest GitHub code? Or specific commit (e.g., d52878f)? Or specific version from Release section (e.g., 1.2.0)? 1.7.0

  3. General configuration:

    • Installation mode: CMake, sh script, manual Makefile installation, ... (Ubuntu); CMake, ... (Windows); ...?
    • Operating system (lsb_release -a in Ubuntu): Ubuntu
    • Operating system version (e.g., Ubuntu 16, Windows 10, ...): Ubuntu 18
    • Release or Debug mode? (by default: release):
    • Compiler (gcc --version in Ubuntu or VS version in Windows): 5.4.0, ... (Ubuntu); VS2015 Enterprise Update 3, VS2017 community, ... (Windows); ...?
  4. Non-default settings:

    • 3-D Reconstruction module added? (by default: no):
    • Any other custom CMake configuration with respect to the default version? (by default: no):
  5. 3rd-party software:

    • Caffe version: Default from OpenPose, custom version, ...?
    • CMake version (cmake --version in Ubuntu):
    • OpenCV version: pre-compiled apt-get install libopencv-dev (only Ubuntu); OpenPose default (only Windows); compiled from source? If so, 2.4.9, 2.4.12, 3.1, 3.2?; ...?
  6. If GPU mode issue:

    • CUDA version (cat /usr/local/cuda/version.txt in most cases):
    • cuDNN version:
    • GPU model (nvidia-smi in Ubuntu):
  7. If CPU-only mode issue:

    • CPU brand & model:
    • Total RAM memory available:
  8. If Python API:

    • Python version: 2.7, 3.7, ...?
    • Numpy version (python -c "import numpy; print numpy.version.version" in Ubuntu):
  9. If Windows system:

    • Portable demo or compiled library?
  10. If speed performance issue:

mobeeniqbal101 commented 2 years ago

The following python folder is present in the build folder, but the error is still appearing:

image

thofes commented 1 year ago

During Building process following warning appears again and again:

_/content/openpose/3rdparty/caffe/include/caffe/util/cudnn.hpp: In function ‘const char* cudnnGetErrorString(cudnnStatus_t)’: /content/openpose/3rdparty/caffe/include/caffe/util/cudnn.hpp:21:8: warning: enumeration value ‘CUDNN_STATUS_VERSIONMISMATCH’ not handled in switch [-Wswitch] switch (status) {

It seems to be the same Problem than in issue 2157 ([https://github.com/CMU-Perceptual-Computing-Lab/openpose/issues/2157]) - a version missmatch between Cuda and cuDNN.

I am running it on Google Colab and since the warning appears the python skripts do not work anymore.

davidpagnon commented 1 year ago

I am facing the same issue. Any solution yet?

mobeeniqbal101 commented 1 year ago

You need to check advanced settings while building via the cmake gui, it has to do with python3 vs python2 difference.

davidpagnon commented 1 year ago

I made it work by running !apt install --allow-change-held-packages libcudnn8=8.1.0.77-1+cuda11.2 afterwards, in order to use compatible CUDA and cuDNN versions. Not sure how this worked but I'm okay with dark magic sometimes.