InterDigitalInc / CompressAI

A PyTorch library and evaluation platform for end-to-end compression research
https://interdigitalinc.github.io/CompressAI/
BSD 3-Clause Clear License
1.19k stars 232 forks source link

No module named 'compressai._CXX' #102

Closed jxchen01 closed 2 years ago

jxchen01 commented 3 years ago

Bug

After training a model, when I try to update the model by python -m compressai.utils.update_model --architecture mtb2018 checkpoint_best_loss.pth.tar, i got the following error:

Traceback (most recent call last): File "/home/nodeadmin/anaconda3/envs/compress/lib/python3.8/runpy.py", line 185, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error) File "/home/nodeadmin/anaconda3/envs/compress/lib/python3.8/runpy.py", line 111, in _get_module_details import(pkg_name) File "/home/nodeadmin/research/tcell/compressai/compressai/init.py", line 15, in from compressai import datasets, entropy_models, layers, models, ops File "/home/nodeadmin/research/tcell/compressai/compressai/entropy_models/init.py", line 15, in from .entropy_models import EntropyBottleneck, EntropyModel, GaussianConditional File "/home/nodeadmin/research/tcell/compressai/compressai/entropy_models/entropy_models.py", line 13, in from compressai._CXX import pmf_to_quantized_cdf as _pmf_to_quantized_cdf ModuleNotFoundError: No module named 'compressai._CXX'

To Reproduce

Steps to reproduce the behavior:

  1. train a model
  2. run python -m compressai.utils.update_model --architecture mtb2018 checkpoint_best_loss.pth.tar

Expected behavior

no error

Environment

Please copy and paste the output from python3 -m torch.utils.collect_env

Collecting environment information... PyTorch version: 1.8.2+cu111 Is debug build: False CUDA used to build PyTorch: 11.1 ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.3 LTS (x86_64) GCC version: (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0 Clang version: Could not collect CMake version: Could not collect

Python version: 3.8 (64-bit runtime) Is CUDA available: True CUDA runtime version: Could not collect GPU models and configuration: GPU 0: A100-SXM4-40GB GPU 1: A100-SXM4-40GB GPU 2: A100-SXM4-40GB GPU 3: A100-SXM4-40GB GPU 4: A100-SXM4-40GB GPU 5: A100-SXM4-40GB GPU 6: A100-SXM4-40GB GPU 7: A100-SXM4-40GB

Nvidia driver version: 450.142.00 cuDNN version: Could not collect HIP runtime version: N/A MIOpen runtime version: N/A

Versions of relevant libraries: [pip3] numpy==1.21.3 [pip3] pytorch-msssim==0.2.1 [pip3] torch==1.8.2+cu111 [pip3] torchaudio==0.8.2 [pip3] torchvision==0.9.2+cu111 [conda] numpy 1.21.3 pypi_0 pypi [conda] pytorch-msssim 0.2.1 pypi_0 pypi [conda] torch 1.8.2+cu111 pypi_0 pypi [conda] torchaudio 0.8.2 pypi_0 pypi [conda] torchvision 0.9.2+cu111 pypi_0 pypi

- PyTorch / CompressAI Version (e.g., 1.0 / 0.4.0): PyTorch version: 1.8.2+cu111
- OS (e.g., Linux): Linux
- How you installed PyTorch / CompressAI (`pip`, source):  pip
- Build command you used (if compiling from source):
- Python version: 3.8
- CUDA/cuDNN version: 11.1
- GPU models and configuration:
- Any other relevant information:

All other packages in the environment:

Package                       Version
----------------------------- -----------
aicsimageio                   4.4.0
alabaster                     0.7.12
argon2-cffi                   21.1.0
asciitree                     0.3.3
attrs                         21.2.0
Babel                         2.9.1
backcall                      0.2.0
beautifulsoup4                4.10.0
black                         21.9b0
bleach                        4.1.0
certifi                       2021.10.8
cffi                          1.15.0
charset-normalizer            2.0.7
click                         8.0.3
cloudpickle                   2.0.0
compressai                    1.1.9.dev0
coverage                      6.0.2
cycler                        0.10.0
dask                          2021.10.0
debugpy                       1.5.1
decorator                     5.1.0
defusedxml                    0.7.1
dnspython                     2.1.0
docutils                      0.17.1
elementpath                   2.3.2
email-validator               1.1.3
entrypoints                   0.3
fasteners                     0.16.3
flake8                        4.0.1
flake8-bugbear                21.9.2
flake8-comprehensions         3.7.0
fsspec                        2021.10.1
furo                          2021.10.9
idna                          3.3
imagecodecs                   2021.8.26
imageio                       2.9.0
imagesize                     1.2.0
iniconfig                     1.1.1
ipykernel                     6.4.2
ipython                       7.28.0
ipython-genutils              0.2.0
ipywidgets                    7.6.5
isort                         5.9.3
jedi                          0.18.0
Jinja2                        3.0.2
jsonschema                    4.1.2
jupyter                       1.0.0
jupyter-client                7.0.6
jupyter-console               6.4.0
jupyter-core                  4.8.1
jupyterlab-pygments           0.1.2
jupyterlab-widgets            1.0.2
kiwisolver                    1.3.2
locket                        0.2.1
lxml                          4.6.3
MarkupSafe                    2.0.1
matplotlib                    3.4.3
matplotlib-inline             0.1.3
mccabe                        0.6.1
mistune                       0.8.4
mypy                          0.910
mypy-extensions               0.4.3
nbclient                      0.5.4
nbconvert                     6.2.0
nbformat                      5.1.3
nest-asyncio                  1.5.1
networkx                      2.6.3
notebook                      6.4.5
numcodecs                     0.9.1
numpy                         1.21.3
ome-types                     0.2.9
packaging                     21.0
pandas                        1.3.4
pandocfilters                 1.5.0
parso                         0.8.2
partd                         1.2.0
pathspec                      0.9.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        8.4.0
Pint                          0.17
pip                           21.2.4
platformdirs                  2.4.0
pluggy                        1.0.0
prometheus-client             0.11.0
prompt-toolkit                3.0.21
ptyprocess                    0.7.0
py                            1.10.0
pycodestyle                   2.8.0
pycparser                     2.20
pydantic                      1.8.2
pyflakes                      2.4.0
Pygments                      2.10.0
pyparsing                     3.0.1
pyrsistent                    0.18.0
pytest                        6.2.5
pytest-cov                    3.0.0
python-dateutil               2.8.2
pytorch-msssim                0.2.1
pytz                          2021.3
PyWavelets                    1.1.1
PyYAML                        6.0
pyzmq                         22.3.0
qtconsole                     5.1.1
QtPy                          1.11.2
regex                         2021.10.23
requests                      2.26.0
scikit-image                  0.18.3
scipy                         1.7.1
Send2Trash                    1.8.0
setuptools                    58.0.4
six                           1.16.0
snowballstemmer               2.1.0
soupsieve                     2.2.1
Sphinx                        4.2.0
sphinxcontrib-applehelp       1.0.2
sphinxcontrib-devhelp         1.0.2
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.5
terminado                     0.12.1
testpath                      0.5.0
tifffile                      2021.10.12
toml                          0.10.2
tomli                         1.2.2
toolz                         0.11.1
torch                         1.8.2+cu111
torchaudio                    0.8.2
torchvision                   0.9.2+cu111
tornado                       6.1
traitlets                     5.1.1
typing-extensions             3.10.0.2
urllib3                       1.26.7
wcwidth                       0.2.5
webencodings                  0.5.1
wheel                         0.37.0
widgetsnbextension            3.5.1
wrapt                         1.13.2
xarray                        0.19.0
xmlschema                     1.8.1
zarr                          2.10.2
fracape commented 2 years ago

Hi. This seems to relate to https://github.com/InterDigitalInc/CompressAI/issues/26. Please let me know if that fixes your issue

SailVR commented 2 years ago

Hi. This seems to relate to #26. Please let me know if that fixes your issue

cd compressai pip install -e .

jayagami commented 2 years ago

rebuild you compressAI package with correct g++ version. 9.5 works for me.

Zhenxing-Dong commented 1 year ago

rebuild you compressAI package with correct g++ version. 9.5 works for me.

How do I choose the correct g++ version when I rebuild my compressAI package?