Daniil-Osokin / lightweight-human-pose-estimation-3d-demo.pytorch

Real-time 3D multi-person pose estimation demo in PyTorch. OpenVINO backend can be used for fast inference on CPU.
Apache License 2.0
656 stars 138 forks source link

Import error for pose_extractor #39

Closed arjun-98 closed 3 years ago

arjun-98 commented 3 years ago

Hello Daniil, After successfully running python setup.py build_ext and adding the result to the PYTHONPATH, I get a Segementation Fault 11 when trying to run the demo.py. I checked the the path using python -c "import sys; print(sys.path) and the appropriate path('/xxx/lightweight-human-pose-estimation-3d-demo.pytorch/pose_extractor/build') is part of the list. If I run python -c " from pose_extractor import extract_poses I get the same segmentation fault 11.

The full error message for the first part is: objc[4980]: Class CaptureDelegate is implemented in both /xxx/python3.7/site-packages/cv2/cv2.cpython-37m-darwin.so (0x11214f7d8) and /xxxi/lib/libopencv_videoio.3.4.2.dylib (0x123d6c8e8). One of the two will be used. Which one is undefined. Segmentation fault: 11

I am currently using an Anaconda environment. My operating system is MacOs Catalina. Thank you

Daniil-Osokin commented 3 years ago

Hi! The error tells, that there are two OpenCV version installed, so you should use only one (delete the second one, or somehow dispatch between Python and C++ symbols of CaptureDelegate).

arjun-98 commented 3 years ago

Hello, thank you for taking the time to reply. I deleted one version, ran it again(rebuilt and exported path again for safe measure), now I simply received a Segmentation Fault 11.

Also if simply I run python -c " from pose_extractor import extract_poses" I still get the same segmentation fault 11.

I cloned the environment twice, and deleted the first instance of OpenCV in one and the the other instance in the second. When the second instance is deleted the code does not run, with the first instance there are no errors before the Segmentation fault 11.

Thank you

Daniil-Osokin commented 3 years ago

This looks strange. If you have environment where OpenCV installed in Python, you may run just demo.py (without building C++ extension with setup.py), it will use just Python version of OpenCV.

arjun-98 commented 3 years ago

Yes, that loads the legacy slow implementation right? Since I don't have a GPU that runs at 0.1 FPS (I have 2.3 GHz Dual-Core Intel Core i5). Is that the expected speed with the given hardware? Because it was running at that speed I was attempting to run the fast implementation.

Daniil-Osokin commented 3 years ago

This fps looks reasonable without GPU. For fast inference on CPU suggest to use OpenVINO.

Daniil-Osokin commented 3 years ago

Hope, it helped.