AlphaPose icon indicating copy to clipboard operation
AlphaPose copied to clipboard

运行demo_inference时进度卡住:Loading pose model 后进度为 0% 0/3 [00:00<?, ?it/s]

Open sddpszz opened this issue 3 years ago • 8 comments

您好,最近我正尝试在Ubuntu14.04系统上运行AlphaPose,但是遇到了错误

当我运行demo时,得到了:

(alphapose) username@username-linux:~/AlphaPose$ python scripts/demo_inference.py --cfg configs/coco/resnet/256x192_res50_lr1e-3_1x.yaml --checkpoint pretrained_models/fast_res50_256x192.pth --indir examples/demo/
Loading YOLO model..
Loading pose model from pretrained_models/fast_res50_256x192.pth...
  0%|                                                                                                            | 0/3 [00:00<?, ?it/s]

然后就一直卡在这里了,起初我怀疑是我GPU配置的问题,但是当我添加仅CPU运行的选项时,仍是这种结果

当我添加--sp选项时,则遇到了Segmentation fault错误

想问下这是什么情况,该如何解决,将不胜感激!

下面是我电脑的配置信息

OS:Ubuntu 14.04.6 LTS (GNU/Linux 4.2.0 x86_64)
CPU:Intel(R) Core(TM) i7-10700K 
GPU:GeForce RTX 2070 SUPER

我安装的CUDA版本是10.0,所以我在配置AlphaPose环境时采用了如下指令

conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=10.0 -c pytorch

下面是我conda list的输出结果

# Name                    Version                   Build  Channel
_libgcc_mutex             0.1                        main
_openmp_mutex             4.5                       1_gnu
alphapose                 0.3.0+cbc364f             dev_0    <develop>
blas                      1.0                         mkl
ca-certificates           2021.5.25            h06a4308_1
certifi                   2021.5.30        py36h06a4308_0
cffi                      1.14.5           py36h261ae71_0
chardet                   4.0.0                    pypi_0    pypi
cudatoolkit               10.0.130                      0
cudnn                     7.6.5                cuda10.0_0
cycler                    0.10.0                   py36_0
cython                    0.29.23                  pypi_0    pypi
cython-bbox               0.1.3                    pypi_0    pypi
dbus                      1.13.18              hb2f20db_0
easydict                  1.9                      pypi_0    pypi
expat                     2.4.1                h2531618_2
fontconfig                2.13.1               h6c09931_0
freetype                  2.10.4               h5ab3b9f_0
glib                      2.68.2               h36276a3_0
gst-plugins-base          1.14.0               h8213a91_2
gstreamer                 1.14.0               h28cd5cc_2
icu                       58.2                 he6710b0_3
idna                      2.10                     pypi_0    pypi
intel-openmp              2021.2.0           h06a4308_610
jpeg                      9b                   h024ee3a_2
jsonpatch                 1.32                     pypi_0    pypi
jsonpointer               2.1                      pypi_0    pypi
kiwisolver                1.3.1            py36h2531618_0
lcms2                     2.12                 h3be6417_0
ld_impl_linux-64          2.35.1               h7274673_9
libffi                    3.3                  he6710b0_2
libgcc-ng                 9.3.0               h5101ec6_17
libgomp                   9.3.0               h5101ec6_17
libpng                    1.6.37               hbc83047_0
libstdcxx-ng              9.3.0               hd4cf53a_17
libtiff                   4.2.0                h85742a9_0
libuuid                   1.0.3                h1bed415_2
libwebp-base              1.2.0                h27cfd23_0
libxcb                    1.14                 h7b6447c_0
libxml2                   2.9.10               hb55368b_3
lz4-c                     1.9.3                h2531618_0
matplotlib                2.2.2            py36hb69df0a_2
mkl                       2020.2                      256
mkl-service               2.3.0            py36he8ac12f_0
mkl_fft                   1.3.0            py36h54f3939_0
mkl_random                1.1.1            py36h0573a6f_0
munkres                   1.1.4                    pypi_0    pypi
natsort                   7.1.1                    pypi_0    pypi
ncurses                   6.2                  he6710b0_1
ninja                     1.10.2               hff7bd54_1
numpy                     1.19.2           py36h54aff64_0
numpy-base                1.19.2           py36hfa32c7d_0
olefile                   0.46                     py36_0
opencv-python             4.5.2.54                 pypi_0    pypi
openssl                   1.1.1k               h27cfd23_0
pcre                      8.44                 he6710b0_0
pillow                    8.2.0            py36he98fc37_0
pip                       21.1.2           py36h06a4308_0
protobuf                  4.0.0rc2                 pypi_0    pypi
pycocotools               2.0.0                    pypi_0    pypi
pycparser                 2.20                       py_2
pyparsing                 2.4.7              pyhd3eb1b0_0
pyqt                      5.9.2            py36h05f1152_2
python                    3.6.13               h12debd9_1
python-dateutil           2.8.1              pyhd3eb1b0_0
pytorch                   1.1.0           py3.6_cuda10.0.130_cudnn7.5.1_0    pytorch
pytz                      2021.1             pyhd3eb1b0_0
pyyaml                    5.4.1                    pypi_0    pypi
pyzmq                     22.1.0                   pypi_0    pypi
qt                        5.9.7                h5867ecd_1
readline                  8.1                  h27cfd23_0
requests                  2.25.1                   pypi_0    pypi
scipy                     1.1.0                    pypi_0    pypi
setuptools                52.0.0           py36h06a4308_0
sip                       4.19.8           py36hf484d3e_0
six                       1.16.0             pyhd3eb1b0_0
sqlite                    3.35.4               hdfb4753_0
tensorboardx              2.2                      pypi_0    pypi
timm                      0.1.20                   pypi_0    pypi
tk                        8.6.10               hbc83047_0
torchvision               0.3.0           py36_cu10.0.130_1    pytorch
tornado                   6.1              py36h27cfd23_0
tqdm                      4.61.1                   pypi_0    pypi
urllib3                   1.26.5                   pypi_0    pypi
visdom                    0.1.8.9                  pypi_0    pypi
websocket-client          1.1.0                    pypi_0    pypi
wheel                     0.36.2             pyhd3eb1b0_0
xz                        5.2.5                h7b6447c_0
zlib                      1.2.11               h7b6447c_3
zstd                      1.4.9                haebb681_0

sddpszz avatar Jun 20 '21 14:06 sddpszz

我也是这种情况,以及处理-video视频时,会卡在最后一帧的处理结果上,生成的视频进度要慢于控制台的运行速度。

Chu4nQ1n avatar Jul 05 '21 21:07 Chu4nQ1n

同样!请问你们解决这个问题了吗?

WXLL579 avatar Jul 09 '21 02:07 WXLL579

Did it resolve? I'm also facing the same issue.

srikamalteja avatar Jul 28 '21 19:07 srikamalteja

我前后反复安装了多次,下面是我的尝试历程:

  • 报错:.cpython-36m-x86_64-linux-gnu.so: undefined symbol,原因,cuda版本不匹配,重新安装cuda10.1以及配套pytorch等后错误消失
  • 运行python setup.py build develop时出现command 'gcc' failed with exit status 1,原因是未安装gcc,安装gcc后该错误消失
  • 但是安装了 gcc4.8 后,运行此条指令又报错:GLIBCXX3.4.21 not find,此处原因是gcc版本过低,手动安装了gcc5.2.0后问题解决

现在已经能够开始识别,但是处理多张图片时会出现unable to open shared memory问题,另外有时会卡在最后几帧,以至于无法生成.json文件,如下:

Loading YOLO model..
Loading pose model from pretrained_models/fast_res50_256x192.pth...
 75%|██████████████████████████████                            | 28579/38288 [30:38<10:37, 15.23it/s]
Traceback (most recent call last):
  File "/home/username/miniconda3/envs/alphapose2/lib/python3.6/multiprocessing/queues.py", line 234, in _feed
    obj = _ForkingPickler.dumps(obj)
  File "/home/username/miniconda3/envs/alphapose2/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
  File "/home/username/miniconda3/envs/alphapose2/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 324, in reduce_storage
    metadata = storage._share_filename_()
RuntimeError: unable to open shared memory object </torch_11243_1370679680> in read-write mode
 81%|████████████████████████████████████                      | 31006/38288 [33:14<09:22, 12.94it/s]
Traceback (most recent call last):
  File "/home/username/miniconda3/envs/alphapose2/lib/python3.6/multiprocessing/queues.py", line 234, in _feed
    obj = _ForkingPickler.dumps(obj)
  File "/home/username/miniconda3/envs/alphapose2/lib/python3.6/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
  File "/home/username/miniconda3/envs/alphapose2/lib/python3.6/site-packages/torch/multiprocessing/reductions.py", line 324, in reduce_storage
    metadata = storage._share_filename_()
RuntimeError: unable to open shared memory object </torch_11243_2689742914> in read-write mode
100%|█████████████████████████████████████████████████████████  | 38282/38288 [36:00<00:00, 59.64it/s]

sddpszz avatar Jul 29 '21 02:07 sddpszz

我用torch.cuda.is_available()发现结果为False,重新安装cuda后解决了这个问题。 I found the output of 'torch.cuda.is_available()' is False, and I fixed this problem by reinstalling cuda.

WeijianZhang123 avatar Aug 04 '21 04:08 WeijianZhang123

请问您安装的那个版本的cuda呢

Kind regards, Chuan

在 2021年8月4日,12:31,WeijianZhang @.***> 写道:

 我用torch.cuda.is_available()发现结果为False,重新安装cuda后解决了这个问题。 I found the output of 'torch.cuda.is_available()' is False, and I fixed this problem by reinstalling cuda.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

Chu4nQ1n avatar Aug 04 '21 04:08 Chu4nQ1n

请问您安装的那个版本的cuda呢 Kind regards, Chuan 在 2021年8月4日,12:31,WeijianZhang @.***> 写道:  我用torch.cuda.is_available()发现结果为False,重新安装cuda后解决了这个问题。 I found the output of 'torch.cuda.is_available()' is False, and I fixed this problem by reinstalling cuda. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

ubuntu16 python==3.6 pytorch==1.1.0 cuda==10.0.130

WeijianZhang123 avatar Aug 04 '21 04:08 WeijianZhang123

我是重新导入了一下环境变量,因为官方的导入方式是暂时性的 export PATH=/usr/local/cuda-11.3/bin/:$PATH export LD_LIBRARY_PATH=/usr/local/cuda-11.3/lib64/:$LD_LIBRARY_PATH 之后就可以正常加载了

maple-zero avatar Jun 08 '23 08:06 maple-zero