Arthur151 / ROMP

Monocular, One-stage, Regression of Multiple 3D People and their 3D positions & trajectories in camera & global coordinates. ROMP[ICCV21], BEV[CVPR22], TRACE[CVPR2023]
https://www.yusun.work/
Apache License 2.0
1.36k stars 231 forks source link

[simple-romp] Dependency issues & questions #315

Open vivi90 opened 2 years ago

vivi90 commented 2 years ago

I have..

Some dependency questions

  1. For CPU rendering you recommend to use the --onnx parameter, wich installs onnxruntime. Why you not also recommend this for GPU rendering with onnxruntime-gpu?

and..

Some pip issues

  1. pip install simple-romp requires also numpy and cython but pip does not resolve it properly, so i need to use pip install simple-romp cython numpy instead.
  2. If i am using the -t parameter for temporal optimization, then it installs norfair. simple-romp works as expected but i get the message:
    ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    simple-romp 1.0.5 requires typing-extensions>=4.1scipy, but you have typing-extensions 3.10.0.2 which is incompatible.

Full error message:

(romp) PS C:\Users\Vivien> romp --mode=webcam --show -t
Using ROMP v1
To perform temporal optimization, installing norfair for tracking.
Collecting norfair
  Using cached norfair-1.0.0-py3-none-any.whl (24 kB)
Collecting filterpy<2.0.0,>=1.4.5
  Using cached filterpy-1.4.5-py3-none-any.whl
Collecting rich<10.0.0,>=9.10.0
  Using cached rich-9.13.0-py3-none-any.whl (197 kB)
Collecting scipy
  Using cached scipy-1.8.1-cp310-cp310-win_amd64.whl (36.9 MB)
Requirement already satisfied: numpy in c:\tools\miniconda3\envs\romp\lib\site-packages (from filterpy<2.0.0,>=1.4.5->norfair) (1.23.1)
Collecting matplotlib
  Using cached matplotlib-3.5.2-cp310-cp310-win_amd64.whl (7.2 MB)
Collecting typing-extensions<4.0.0,>=3.7.4
  Using cached typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting pygments<3.0.0,>=2.6.0
  Using cached Pygments-2.12.0-py3-none-any.whl (1.1 MB)
Collecting commonmark<0.10.0,>=0.9.0
  Using cached commonmark-0.9.1-py2.py3-none-any.whl (51 kB)
Collecting colorama<0.5.0,>=0.4.0
  Using cached colorama-0.4.5-py2.py3-none-any.whl (16 kB)
Collecting kiwisolver>=1.0.1
  Using cached kiwisolver-1.4.4-cp310-cp310-win_amd64.whl (55 kB)
Collecting pyparsing>=2.2.1
  Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting fonttools>=4.22.0
  Using cached fonttools-4.34.4-py3-none-any.whl (944 kB)
Requirement already satisfied: pillow>=6.2.0 in c:\tools\miniconda3\envs\romp\lib\site-packages (from matplotlib->filterpy<2.0.0,>=1.4.5->norfair) (9.2.0)
Collecting cycler>=0.10
  Using cached cycler-0.11.0-py3-none-any.whl (6.4 kB)
Collecting packaging>=20.0
  Using cached packaging-21.3-py3-none-any.whl (40 kB)
Collecting python-dateutil>=2.7
  Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting six>=1.5
  Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: typing-extensions, commonmark, six, scipy, pyparsing, pygments, kiwisolver, fonttools, cycler, colorama, rich, python-dateutil, packaging, matplotlib, filterpy, norfair
  Attempting uninstall: typing-extensions
    Found existing installation: typing_extensions 4.3.0
    Uninstalling typing_extensions-4.3.0:
      Successfully uninstalled typing_extensions-4.3.0
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
simple-romp 1.0.5 requires typing-extensions>=4.1scipy, but you have typing-extensions 3.10.0.2 which is incompatible.
Successfully installed colorama-0.4.5 commonmark-0.9.1 cycler-0.11.0 filterpy-1.4.5 fonttools-4.34.4 kiwisolver-1.4.4 matplotlib-3.5.2 norfair-1.0.0 packaging-21.3 pygments-2.12.0 pyparsing-3.0.9 python-dateutil-2.8.2 rich-9.13.0 scipy-1.8.1 six-1.16.0 typing-extensions-3.10.0.2
C:\tools\miniconda3\envs\romp\lib\site-packages\romp\post_parser.py:34: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  topk_ys = (topk_inds.long() // w).float()
C:\tools\miniconda3\envs\romp\lib\site-packages\romp\post_parser.py:39: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  topk_clses = index.long() // K
C:\tools\miniconda3\envs\romp\lib\site-packages\romp\post_parser.py:144: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
  parsed_results['center_preds'] = torch.stack([flat_inds%64, flat_inds//64],1) * 512 // 64
ROMP 'forward' executed in 2.5916s, FPS 0.4
ROMP 'forward' executed in 0.1020s, FPS 9.8
...

How to reproduce

conda create -n romp python=3.10
conda activate romp
pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
pip install simple-romp cython
romp --mode=webcam --show -t

Installed packages

(romp) PS C:\Users\Vivien> conda list
# packages in environment at C:\tools\miniconda3\envs\romp:
#
# Name                    Version                   Build  Channel
bzip2                     1.0.8                he774522_0
ca-certificates           2022.4.26            haa95532_0
certifi                   2022.6.15       py310haa95532_0
charset-normalizer        2.1.0                    pypi_0    pypi
colorama                  0.4.5                    pypi_0    pypi
commonmark                0.9.1                    pypi_0    pypi
cycler                    0.11.0                   pypi_0    pypi
cython                    0.29.30                  pypi_0    pypi
filterpy                  1.4.5                    pypi_0    pypi
fonttools                 4.34.4                   pypi_0    pypi
idna                      3.3                      pypi_0    pypi
kiwisolver                1.4.4                    pypi_0    pypi
lap                       0.4.0                    pypi_0    pypi
libffi                    3.4.2                hd77b12b_4
matplotlib                3.5.2                    pypi_0    pypi
norfair                   1.0.0                    pypi_0    pypi
numpy                     1.23.1                   pypi_0    pypi
opencv-python             4.6.0.66                 pypi_0    pypi
openssl                   1.1.1q               h2bbff1b_0
packaging                 21.3                     pypi_0    pypi
pillow                    9.2.0                    pypi_0    pypi
pip                       22.1.2          py310haa95532_0
pygments                  2.12.0                   pypi_0    pypi
pyparsing                 3.0.9                    pypi_0    pypi
python                    3.10.4               hbb2ffb3_0
python-dateutil           2.8.2                    pypi_0    pypi
requests                  2.28.1                   pypi_0    pypi
rich                      9.13.0                   pypi_0    pypi
scipy                     1.8.1                    pypi_0    pypi
setuptools                61.2.0          py310haa95532_0
simple-romp               1.0.5                    pypi_0    pypi
six                       1.16.0                   pypi_0    pypi
sqlite                    3.38.5               h2bbff1b_0
tk                        8.6.12               h2bbff1b_0
torch                     1.12.0+cu113             pypi_0    pypi
torchaudio                0.12.0+cu113             pypi_0    pypi
torchvision               0.13.0+cu113             pypi_0    pypi
typing-extensions         3.10.0.2                 pypi_0    pypi
tzdata                    2022a                hda174b7_0
urllib3                   1.26.10                  pypi_0    pypi
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wheel                     0.37.1             pyhd3eb1b0_0
wincertstore              0.2             py310haa95532_2
xz                        5.2.5                h8cc25b3_1
zlib                      1.2.12               h8cc25b3_2

and..

Some conda, or to be more clear, cython issues

I get: RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf.

Full error message:

(romp) PS C:\Users\Vivien> romp --mode=webcam --show
Using ROMP v1
Traceback (most recent call last):
  File "__init__.pxd", line 942, in numpy.import_array
RuntimeError: module compiled against API version 0x10 but this version of numpy is 0xf

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\tools\miniconda3\envs\romp\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\tools\miniconda3\envs\romp\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\tools\miniconda3\envs\romp\Scripts\romp.exe\__main__.py", line 7, in <module>
  File "C:\tools\miniconda3\envs\romp\lib\site-packages\romp\main.py", line 177, in main
    romp = ROMP(args)
  File "C:\tools\miniconda3\envs\romp\lib\site-packages\romp\main.py", line 68, in __init__
    self._initilization_()
  File "C:\tools\miniconda3\envs\romp\lib\site-packages\romp\main.py", line 102, in _initilization_
    self.renderer = setup_renderer(name=self.settings.renderer)
  File "C:\tools\miniconda3\envs\romp\lib\site-packages\vis_human\main.py", line 13, in setup_renderer
    from vis_human.sim3drender import Sim3DR
  File "C:\tools\miniconda3\envs\romp\lib\site-packages\vis_human\sim3drender\__init__.py", line 3, in <module>
    from .renderer import Sim3DR
  File "C:\tools\miniconda3\envs\romp\lib\site-packages\vis_human\sim3drender\renderer.py", line 4, in <module>
    import Sim3DR_Cython
  File "vis_human\sim3drender\lib\rasterize.pyx", line 10, in init Sim3DR_Cython
  File "__init__.pxd", line 944, in numpy.import_array
ImportError: numpy.core.multiarray failed to import

How to reproduce

conda create -n romp python=3.10
conda activate romp
conda install pytorch torchvision torchaudio cudatoolkit=11.3 -c pytorch
pip install simple-romp cython
romp --mode=webcam --show

Installed packages

(romp) PS C:\Users\Vivien> conda list
# packages in environment at C:\tools\miniconda3\envs\romp:
#
# Name                    Version                   Build  Channel
blas                      1.0                         mkl
brotlipy                  0.7.0           py310h2bbff1b_1002
bzip2                     1.0.8                he774522_0
ca-certificates           2022.4.26            haa95532_0
certifi                   2022.6.15       py310haa95532_0
cffi                      1.15.0          py310h2bbff1b_1
charset-normalizer        2.0.4              pyhd3eb1b0_0
cryptography              37.0.1          py310h21b164f_0
cudatoolkit               11.3.1               h59b6b97_2
cython                    0.29.30                  pypi_0    pypi
freetype                  2.10.4               hd328e21_0
idna                      3.3                pyhd3eb1b0_0
intel-openmp              2021.4.0          haa95532_3556
jpeg                      9e                   h2bbff1b_0
lap                       0.4.0                    pypi_0    pypi
libffi                    3.4.2                hd77b12b_4
libpng                    1.6.37               h2a8f88b_0
libtiff                   4.2.0                he0120a3_1
libuv                     1.40.0               he774522_0
libwebp                   1.2.2                h2bbff1b_0
lz4-c                     1.9.3                h2bbff1b_1
mkl                       2021.4.0           haa95532_640
mkl-service               2.4.0           py310h2bbff1b_0
mkl_fft                   1.3.1           py310ha0764ea_0
mkl_random                1.2.2           py310h4ed8f06_0
numpy                     1.22.3          py310h6d2d95c_0
numpy-base                1.22.3          py310h206c741_0
opencv-python             4.6.0.66                 pypi_0    pypi
openssl                   1.1.1q               h2bbff1b_0
pillow                    9.2.0           py310hdc2b20a_1
pip                       22.1.2          py310haa95532_0
pycparser                 2.21               pyhd3eb1b0_0
pyopenssl                 22.0.0             pyhd3eb1b0_0
pysocks                   1.7.1           py310haa95532_0
python                    3.10.4               hbb2ffb3_0
pytorch                   1.12.0          py3.10_cuda11.3_cudnn8_0    pytorch
pytorch-mutex             1.0                        cuda    pytorch
requests                  2.28.1          py310haa95532_0
setuptools                61.2.0          py310haa95532_0
simple-romp               1.0.5                    pypi_0    pypi
six                       1.16.0             pyhd3eb1b0_1
sqlite                    3.38.5               h2bbff1b_0
tk                        8.6.12               h2bbff1b_0
torchaudio                0.12.0              py310_cu113    pytorch
torchvision               0.13.0              py310_cu113    pytorch
typing_extensions         4.1.1              pyh06a4308_0
tzdata                    2022a                hda174b7_0
urllib3                   1.26.9          py310haa95532_0
vc                        14.2                 h21ff451_1
vs2015_runtime            14.27.29016          h5e58377_2
wheel                     0.37.1             pyhd3eb1b0_0
win_inet_pton             1.1.0           py310haa95532_0
wincertstore              0.2             py310haa95532_2
xz                        5.2.5                h8cc25b3_1
zlib                      1.2.12               h8cc25b3_2
zstd                      1.5.2                h19a0ad4_0

My system

Arthur151 commented 2 years ago

WOW, hi, Vivian, that's a lot issues.

vivi90 commented 2 years ago

@Arthur151 Not a big deal. Just wanted you to be aware of and fixing it later.

vivi90 commented 2 years ago

But back to my question: Is it an good idea to use ONNX with an GPU?

Arthur151 commented 2 years ago

It does bring faster inference speed, althought not as significant as I supposed.