MVIG-SJTU / AlphaPose

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

python setup.py build develop / No CUDA runtime error #1088

Open DOG-j opened 1 year ago

DOG-j commented 1 year ago

Hi, I want to use AlphaPose but I cant fixed it Rtx 1060ti Ubuntu 20.04 Cuda Ver 11.7

-> virtual env Conda 22.9.0

I follow this instruction (imstall.md)

1. Create a conda virtual environment.

conda create -n alphapose python=3.7 -y conda activate alphapose

2. Install PyTorch

conda install pytorch torchvision cudatoolkit=11.3 -c pytorch

3. Get AlphaPose

git clone https://github.com/MVIG-SJTU/AlphaPose.git cd AlphaPose

4. install

export PATH=/usr/local/cuda/bin/:$PATH export LD_LIBRARY_PATH=/usr/local/cuda/lib64/:$LD_LIBRARY_PATH python -m pip install cython sudo apt-get install libyaml-dev ################Only For Ubuntu 18.04################# locale-gen C.UTF-8

if locale-gen not found

sudo apt-get install locales export LANG=C.UTF-8 ###################################################### python setup.py build develop

and my env conda list (alphapose) eslab@eslab:~/AlphaPose$ conda list

packages in environment at /home/eslab/anaconda3/envs/alphapose:

#

Name Version Build Channel

_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
blas 1.0 mkl
brotlipy 0.7.0 py37h27cfd23_1003
bzip2 1.0.8 h7b6447c_0
ca-certificates 2022.10.11 h06a4308_0
certifi 2022.9.24 py37h06a4308_0
cffi 1.15.1 py37h74dc2b5_0
charset-normalizer 2.0.4 pyhd3eb1b0_0
cryptography 38.0.1 py37h9ce1e76_0
cudatoolkit 11.3.1 h2bc3f7f_2
cython 0.29.32 pypi_0 pypi ffmpeg 4.3 hf484d3e_0 pytorch freetype 2.12.1 h4a9f257_0
giflib 5.2.1 h7b6447c_0
gmp 6.2.1 h295c915_3
gnutls 3.6.15 he1e5248_0
idna 3.4 py37h06a4308_0
intel-openmp 2021.4.0 h06a4308_3561
jpeg 9e h7f8727e_0
lame 3.100 h7b6447c_0
lcms2 2.12 h3be6417_0
ld_impl_linux-64 2.38 h1181459_1
lerc 3.0 h295c915_0
libdeflate 1.8 h7f8727e_5
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libiconv 1.16 h7f8727e_2
libidn2 2.3.2 h7f8727e_0
libpng 1.6.37 hbc83047_0
libstdcxx-ng 11.2.0 h1234567_1
libtasn1 4.16.0 h27cfd23_0
libtiff 4.4.0 hecacb30_0
libunistring 0.9.10 h27cfd23_0
libuv 1.40.0 h7b6447c_0
libwebp 1.2.4 h11a3e52_0
libwebp-base 1.2.4 h5eee18b_0
lz4-c 1.9.3 h295c915_1
mkl 2021.4.0 h06a4308_640
mkl-service 2.4.0 py37h7f8727e_0
mkl_fft 1.3.1 py37hd3c417c_0
mkl_random 1.2.2 py37h51133e4_0
ncurses 6.3 h5eee18b_3
nettle 3.7.3 hbbd107a_1
numpy 1.21.5 py37h6c91a56_3
numpy-base 1.21.5 py37ha15fc14_3
openh264 2.1.1 h4ff587b_0
openssl 1.1.1q h7f8727e_0
pillow 9.2.0 py37hace64e9_1
pip 22.2.2 py37h06a4308_0
pycparser 2.21 pyhd3eb1b0_0
pyopenssl 22.0.0 pyhd3eb1b0_0
pysocks 1.7.1 py37_1
python 3.7.13 haa1d7c7_1
pytorch 1.11.0 py3.7_cpu_0 pytorch pytorch-mutex 1.0 cpu pytorch readline 8.2 h5eee18b_0
requests 2.28.1 py37h06a4308_0
setuptools 65.5.0 py37h06a4308_0
six 1.16.0 pyhd3eb1b0_1
sqlite 3.39.3 h5082296_0
tk 8.6.12 h1ccaba5_0
torchaudio 0.11.0 py37_cpu pytorch torchvision 0.12.0 py37_cpu pytorch typing_extensions 4.3.0 py37h06a4308_0
urllib3 1.26.12 py37h06a4308_0
wheel 0.37.1 pyhd3eb1b0_0
xz 5.2.6 h5eee18b_0
zlib 1.2.13 h5eee18b_0
zstd 1.5.2 ha4553b6_0


but i have this error, What can i do?

(alphapose) eslab@eslab:~/AlphaPose$ python setup.py build develop --user No CUDA runtime is found, using CUDA_HOME='/usr/local/cuda' /home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/installer.py:30: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer. SetuptoolsDeprecationWarning, running build running build_py copying alphapose/version.py -> build/lib.linux-x86_64-cpython-37/alphapose running build_ext /home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/torch/utils/cpp_extension.py:387: UserWarning: Attempted to use ninja as the BuildExtension backend but we could not find ninja.. Falling back to using the slow distutils backend. warnings.warn(msg.format('we could not find ninja.')) Traceback (most recent call last): File "setup.py", line 214, in zip_safe=False) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/init.py", line 87, in setup return distutils.core.setup(**attrs) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 968, in run_commands self.run_command(cmd) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.run() File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/command/build.py", line 132, in run self.run_command(cmd_name) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/cmd.py", line 319, in run_command self.distribution.run_command(command) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/dist.py", line 1217, in run_command super().run_command(command) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/dist.py", line 987, in run_command cmd_obj.run() File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/command/build_ext.py", line 84, in run _build_ext.run(self) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run self.build_extensions() File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 410, in build_extensions self._check_cuda_version() File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/torch/utils/cpp_extension.py", line 783, in _check_cuda_version torch_cuda_version = packaging.version.parse(torch.version.cuda) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 49, in parse return Version(version) File "/home/eslab/anaconda3/envs/alphapose/lib/python3.7/site-packages/pkg_resources/_vendor/packaging/version.py", line 264, in init match = self._regex.search(version) TypeError: expected string or bytes-like object

HaoyiZhu commented 1 year ago

Is your cuda available? You can check that with torch.cuda.is_available() in Python. I notice that your cuda version is 11.7 but your cudatoolkit is 11.3.