Implementing Openpose images output model on Google Colab: Can anyone share a working colab notebook · Issue #1736 · CMU-Perceptual-Computing-Lab/openpose · GitHub
Skip to content

Implementing Openpose images output model on Google Colab: Can anyone share a working colab notebook #1736

Closed

Description

@bhavesh2799

I have been taking the help of the google colab helper script, and tried all the installation methods , reinstalling different versions of CUDA, Cmake, etc., but in the notebook there are still configuration errors. I tried the solutions mentioned in the script, but they don't seem to work.
If anyone could share a colab notebook, it would be great!

Activity

  1. changed the title [-]Implementing Openpose Images model on Google Colab: Can anyone share a working colab notebook[/-] [+]Implementing Openpose images output model on Google Colab: Can anyone share a working colab notebook[/+] on Oct 30, 2020
  2. dinatih commented on Dec 1, 2020

    @dinatih
    Contributor
  3. gineshidalgo99 commented on Jan 8, 2021

    @gineshidalgo99
    Member

    Thanks @dinatih ! Added to the doc/installation/README.md!

  4. manlio99 commented on Mar 1, 2021

    @manlio99

    Hi!
    There is any colab with STAF included?

  5. kariskerto commented on Dec 12, 2021

    @kariskerto

    Hello, here is my colab : https://colab.research.google.com/drive/1VDjRLKAu9KLQky0gv4RLJjeH6NRPiWXy?usp=sharing if it can help.

    hello sir, thanks for your colab. i try your colab and it works well. but it only give output video with motion capture mark, no json or cvs files. so can you tell me the additional code for that colab to add json output too

  6. adityab05 commented on Jul 27, 2022

    @adityab05

    Is there a google Colab version which can help me get poses for single images instead of video input ?

  7. abrar-aw commented on Oct 10, 2022

    @abrar-aw

    Hello, here is my colab : https://colab.research.google.com/drive/1VDjRLKAu9KLQky0gv4RLJjeH6NRPiWXy?usp=sharing if it can help.

    Hi there, your colab is really helpful! Could you help me find a way to output the results/coordinate values of the OpenPose being applied videos to JSON files please? Thanks

  8. MazieQueen commented on Oct 18, 2022

    @MazieQueen

    hey @adityab05 did you find a colab for single images ?

  9. rigvedrs commented on Mar 12, 2023

    @rigvedrs

    A notebook for using open pose on single image still does not seem to be available.

  10. davidpagnon commented on May 4, 2023

    @davidpagnon

    @adityab05 @MazieQueen @rigvedrs
    For single images, I believe you can just put your image in an empty directory, and run this line instead (change the parameters between brakets with your own paths)

    !cd openpose && ./build/examples/openpose/openpose.bin --image_dir {IMAGE_DIRECTORY} --write_json ./output/ --display 0  --write_images {OUTPUT_DIRECTORY}
    
  11. davidpagnon commented on May 4, 2023

    @davidpagnon

    I do have an issue though, I keep running into Check failed: error == cudaSuccess (2 vs. 0) out of memory *** Check failure stack trace: ***. And yet,

    • I executed my colab with GPU, with free 15360MB
    • I use CuDNN: cuDNN : Yes (ver. 8.7.0)
    • I tried with minimal computation requirements: plain body_25, --display 0 --render_pose 0 --net_resolution -1x16. Still same error.

    Would you be able to help me?


    EDIT: Well I just realized that this error occurs upon building.

    /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_VERSION_MISMATCH’ not handled in switch [-Wswitch]
    

    So CuDNN faces at least some sort of issue. Any idea how to solve this though?

  12. davidpagnon commented on May 8, 2023

    @davidpagnon

    I finally made it work by running !apt install --allow-change-held-packages libcudnn8=8.1.0.77-1+cuda11.2 to use compatible CUDA and cuDNN versions (see my Sports2D colab: Open In Colab)

  13. Syed-Hamza-Ali commented on Jul 13, 2023

    @Syed-Hamza-Ali

    I finally made it work by running !apt install --allow-change-held-packages libcudnn8=8.1.0.77-1+cuda11.2 to use compatible CUDA and cuDNN versions (see my Sports2D colab: Open In Colab)

    Can you please help me out. I'm Having the same error.
    /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_VERSION_MISMATCH’ not handled in switch [-Wswitch]

  14. davidpagnon commented on Jul 13, 2023

    @davidpagnon

    Hi, I'm sorry I'm just about to start a new job and I'm in a rush to finish my current one 😅
    Did you try copying the steps that are in my colab? Double click on the first cell to show the code.

  15. Syed-Hamza-Ali commented on Jul 13, 2023

    @Syed-Hamza-Ali
  16. Syed-Hamza-Ali commented on Jul 14, 2023

    @Syed-Hamza-Ali
  17. Syed-Hamza-Ali commented on Jul 26, 2023

    @Syed-Hamza-Ali

    Hello, here is my colab : https://colab.research.google.com/drive/1VDjRLKAu9KLQky0gv4RLJjeH6NRPiWXy?usp=sharing if it can help.

    it still gives the error:
    CUDNN_VERSION_MIMATCH

  18. davidpagnon commented on Jul 26, 2023

    @davidpagnon

    Hi there, sorry for the delay, I'm quite busy these days... I just saw that Colab recently upgraded to Ubuntu 22.04, which may have broken the install... I'll have to have a deeper look, but to be fairly honest, I'm not sure I can find this time so I'm happy if someone takes over.

  19. Syed-Hamza-Ali commented on Jul 26, 2023

    @Syed-Hamza-Ali

    Hi there, sorry for the delay, I'm quite busy these days... I just saw that Colab recently upgraded to Ubuntu 22.04, which may have broken the install... I'll have to have a deeper look, but to be fairly honest, I'm not sure I can find this time so I'm happy if someone takes over.

    No worries, Thank you for guidance.
    And if you are going to update I just want to let you know that it throws an error that your specified Cuda version is not found.
    Your sports 2d project gives the same error.

  20. davidpagnon commented on Jul 26, 2023

    @davidpagnon

    Okay so here are my guesses to help you find a solution.

    • !nvidia-smi gives: Cuda version 12.0
    • !nvcc --version gives: Cuda version 11.8
      --> Hence the CuDNN version mismatch

    I previously solved it by force-installing a compatible CUDA / CuDNN combination:
    !apt install --allow-change-held-packages libcudnn8=8.1.0.77-1+cuda11.2.
    The problem is now that Colab has upgraded from Ubuntu 20.04 to Ubuntu 22.04, where this version no longer exists.

    Here are the supported CUDA versions available for Ubuntu 22.04.
    And here are the available CUDA/CuDNN combinations.

    If I choose to take the second compatible one (just to be on the safe side, let's not risk upgrading to CUDA 12 as I don't know how OpenPose would go with it), this leads me to edit the initial line with:
    !apt install --allow-change-held-packages libcudnn8=8.9.3.28-1+cuda11.8.


    Could you reset your environment, try changing just that line (watch out, there are two occurrences), and tell me if this works?
    For example do:

    !cd $openpose_path
    !build/examples/openpose/openpose.bin --video examples/media/video.avi --display 0 --render_pose 0 --write_json examples/media/json
    
  21. Syed-Hamza-Ali commented on Jul 27, 2023

    @Syed-Hamza-Ali

    um now the installation part runs but it gives the following error while using it:
    Auto-detecting all available GPUs... Detected 1 GPU(s), using 1 of them starting at GPU 0.
    F0727 12:35:53.047664 14590 cudnn_conv_layer.cpp:53] Check failed: status == CUDNN_STATUS_SUCCESS (1 vs. 0) CUDNN_STATUS_NOT_INITIALIZED
    *** Check failure stack trace: ***
    @ 0x7a5e79ae9b03 google::LogMessage::Fail()
    @ 0x7a5e79af19d1 google::LogMessage::SendToLog()
    @ 0x7a5e79ae97c2 google::LogMessage::Flush()
    @ 0x7a5e79aeb78f google::LogMessageFatal::~LogMessageFatal()
    @ 0x7a5e7971423b caffe::CuDNNConvolutionLayer<>::LayerSetUp()
    @ 0x7a5e797fd699 caffe::Net<>::Init()
    @ 0x7a5e797ff610 caffe::Net<>::Net()
    @ 0x7a5e7a1e140c op::NetCaffe::initializationOnThread()
    @ 0x7a5e7a18c02b op::FaceExtractorCaffe::netInitializationOnThread()
    @ 0x7a5e7a18d9a6 op::FaceExtractorNet::initializationOnThread()
    @ 0x7a5e7a228b95 op::Worker<>::initializationOnThreadNoException()
    @ 0x7a5e7a228d08 op::SubThread<>::initializationOnThread()
    @ 0x7a5e7a22a708 op::Thread<>::initializationOnThread()
    @ 0x7a5e7a22cc3c op::Thread<>::threadFunction()
    @ 0x7a5e79e352b3 (unknown)
    @ 0x7a5e79ba5b43 (unknown)
    @ 0x7a5e79c37a00 (unknown)
    @ (nil) (unknown)

  22. Syed-Hamza-Ali commented on Jul 27, 2023

    @Syed-Hamza-Ali

    I have changed the version in your colabs but itgives this while running the RUN analysis part:

    ValueError: max() arg is an empty sequence

  23. davidpagnon commented on Jul 27, 2023

    @davidpagnon

    It probably means that there is no output json file.

    Did you do the Google drive install (install once) or the other one? You need to delete the folder on your drive and to disconnect and restart Colab for the changes to take action.

    Did you also try that simpler command after instead of running the whole Sports2D flow?

    !cd $openpose_path
    !build/examples/openpose/openpose.bin --video examples/media/video.avi --display 0 --render_pose 0 --write_json examples/media/json```
    
  24. Syed-Hamza-Ali commented on Jul 27, 2023

    @Syed-Hamza-Ali

    It probably means that there is no output json file.

    Did you do the Google drive install (install once) or the other one? You need to delete the folder on your drive and to disconnect and restart Colab for the changes to take action.

    Did you also try that simpler command after instead of running the whole Sports2D flow?

    !cd $openpose_path
    !build/examples/openpose/openpose.bin --video examples/media/video.avi --display 0 --render_pose 0 --write_json examples/media/json```
    

    Yeah I add that line in other code but it it did the CUDNN error .
    while running the Sports2D I ran install everytime. After installation I ran this command

    !cd $openpose_path
    !build/examples/openpose/openpose.bin --video examples/media/video.avi --display 0 --render_pose 0 --write_json examples/media/json```
    But there was no openpose.bin file it was openpose.cpp file

    which threw the arror of no such file directory exist

  25. AlmaDev40 commented on Sep 24, 2023

    @AlmaDev40

    Hello @Syed-Hamza-Ali

    I did the same changes as you and the installation part seems ok. However I obtain the same error about openpose.bin file not existing. Did you find any solution to install Openpose with collab? Thanks in advance!

  26. Syed-Hamza-Ali commented on Sep 27, 2023

    @Syed-Hamza-Ali

    Hello @Syed-Hamza-Ali

    I did the same changes as you and the installation part seems ok. However I obtain the same error about openpose.bin file not existing. Did you find any solution to install Openpose with collab? Thanks in advance!

    Nope I didn't find any solution... I was told by a fellow that due to collab updation all the projects made on collab using Openpose has been crashed.
    .
    So I decided to use Mediapipe instead. It's a lot similar to openpose

  27. davidpagnon commented on Jan 27, 2024

    @davidpagnon

    Still the same issue of hash mismatch on my Sports2D colab (error referenced there).

    CMake Error at cmake/Utils.cmake:8 (file):
      file DOWNLOAD HASH mismatch
    
        for file: [/content/openpose/models/pose/body_25/pose_iter_584000.caffemodel]
          expected hash: [78287b57cf85fa89c03f1393d368e5b7]
            actual hash: [d41d8cd98f00b204e9800998ecf8427e]
                 status: [7;"Couldn't connect to server"]
    
    Call Stack (most recent call first):
      CMakeLists.txt:985 (download_model)
    

    Running twice the following line seems like it solves the error:

    !cd openpose && rm -rf build || true && mkdir build && cd build && cmake .. && make -j\`nproc\`
    

    And it does run smoothly, but the resulting json files are empty. This is due to the fact that the pose_iter_584000.caffemodel file is created in the first run so running it a second time skips the download, but it is empty.

    Uploading the model files if you have them locally should work, as referenced in this issue: #1588 (comment)

  28. davidpagnon commented on Jan 28, 2024

    @davidpagnon

    I fixed it on my end by downloading the body_25 model from a google drive source. (see there for the whole install in Colab)

    !pip install gdown
    !gdown 1jehFU9xsxEpxRuOEUgA5jaCutR4l9X8a
    !mv pose_iter_584000.caffemodel $openpose_path/models/pose/body_25/pose_iter_584000.caffemodel
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions