MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
7.96k stars 1.97k forks source link

AlphaPose/detector/nms/src/nms_kernel.cu:5:10: fatal error: THC/THC.h: No such file or directory 5 | #include <THC/THC.h> #980

Open lucasjinreal opened 2 years ago

lucasjinreal commented 2 years ago

For decent pytorch version 1.11 (maybe 1.10), this file removed:

AlphaPose/detector/nms/src/nms_kernel.cu:5:10: fatal error: THC/THC.h: No such file or directory
    5 | #include <THC/THC.h>

image

Fang-Haoshu commented 2 years ago

Oh... Did you manage to fix it?

lucasjinreal commented 2 years ago

No, I suggest using torchvision.ops.boxes.nms to do nms operation, however, which needs modification on detector. But since Alphapose already included that source code, it also worthy to modificate to standard way

lucasjinreal commented 2 years ago

Please using my fork version: it works on torch 1.11

https://github.com/jinfagang/AlphaPose

peteruhrig commented 2 years ago

I cloned your repo:

git clone https://github.com/jinfagang/AlphaPose.git

And then ran:

python3 setup.py build develop --user

And I get the same error message:

detector/nms/src/nms_kernel.cu:5:10: fatal error: THC/THC.h: No such file or directory
    5 | #include <THC/THC.h>
      |          ^~~~~~~~~~~
compilation terminated.
error: command '/usr/local/cuda/bin/nvcc' failed with exit status 1

Do I need to use a certain branch?

peteruhrig commented 2 years ago

And it turns out that this is a real show-stopper for A40 and A100 cards. They require CUDA 11.1 or higher, thus PyTorch 1.11 or higher, which does not contain the THC component any more. Thus, as of now, I don't see how to run AlphaPose on recent cards.

yc-cui commented 2 years ago

@jinfagang Still the same error. You didn't modify the code in detector/nms/src/nms_kernel.cu at branch master.

yc-cui commented 2 years ago

And it turns out that this is a real show-stopper for A40 and A100 cards. They require CUDA 11.1 or higher, thus PyTorch 1.11 or higher, which does not contain the THC component any more. Thus, as of now, I don't see how to run AlphaPose on recent cards.

@peteruhrig Any good suggestions?

peteruhrig commented 2 years ago

I don't speak C/C++ well enough, but my understanding is that it is possible to replace the functions used with ones that are still supported, as discussed here: https://www.exxactcorp.com/blog/Deep-Learning/pytorch-1-11-0-now-available (scroll down to the CUDA section) My guess is that this is not very difficult for someone who knows what they are doing, and maybe that is what @jinfagang did but forgot to push back to his repo, but I don't understand it enough to be able to do this myself.