Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'mmcv._ext' (Installation Issues) #1

Open
ab1412 opened this issue Jul 24, 2023 · 15 comments
Open

Comments

@ab1412
Copy link

ab1412 commented Jul 24, 2023

作者你好,我在复现您提供的github代码时出现了以下的报错,似乎和mmcv-full有关,我是通过pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html以及pip install mmcv-full==1.3.0都尝试过,但都是这个报错。请问有什么解决方法吗,以下是报错信息:
(NVDS) qjc@omnisky:/data3/qjcnerf/NVDS$ CUDA_VISIBLE_DEVICES=0 python infer_NVDS_dpt_bi.py --base_dir ./demo_outputs/dpt_init/000423/ --vnum 000423 --infer_w 896 --infer_h 384
Traceback (most recent call last):
File "infer_NVDS_dpt_bi.py", line 19, in
from backbone import *
File "/data3/qjcnerf/NVDS/backbone.py", line 15, in
from mmseg.models.builder import BACKBONES
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/init.py", line 1, in
from .backbones import * # noqa: F401,F403
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/backbones/init.py", line 2, in
from .fast_scnn import FastSCNN
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/backbones/fast_scnn.py", line 7, in
from mmseg.models.decode_heads.psp_head import PPM
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/decode_heads/init.py", line 16, in
from .point_head import PointHead
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/decode_heads/point_head.py", line 6, in
from mmcv.ops import point_sample
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmcv/ops/init.py", line 1, in
from .bbox import bbox_overlaps
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmcv/ops/bbox.py", line 3, in
ext_module = ext_loader.load_ext('_ext', ['bbox_overlaps'])
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmcv/utils/ext_loader.py", line 11, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'mmcv._ext'
以下是我的环境信息:
`(NVDS) qjc@omnisky:/data3/qjcnerf/NVDS$ conda list
packages in environment at /data1/qjc_new/anaconda/envs/NVDS:

Name Version Build Channel
_libgcc_mutex 0.1 main
_openmp_mutex 5.1 1_gnu
addict 2.4.0 pypi_0 pypi
asttokens 2.2.1 pypi_0 pypi
attr 0.3.2 pypi_0 pypi
backcall 0.2.0 pypi_0 pypi
blas 1.0 mkl
bzip2 1.0.8 h7f98852_4 conda-forge
ca-certificates 2023.7.22 hbcca054_0 conda-forge
certifi 2023.7.22 pypi_0 pypi
charset-normalizer 3.2.0 pypi_0 pypi
click 8.1.6 pypi_0 pypi
colorama 0.4.6 pypi_0 pypi
cudatoolkit 11.1.1 ha002fc5_10 conda-forge
cycler 0.11.0 pypi_0 pypi
decorator 5.1.1 pypi_0 pypi
einops 0.4.1 pypi_0 pypi
executing 1.2.0 pypi_0 pypi
ffmpeg 4.3 hf484d3e_0 pytorch
fonttools 4.41.1 pypi_0 pypi
freetype 2.10.4 h0708190_1 conda-forge
gmp 6.2.1 h58526e2_0 conda-forge
gnutls 3.6.13 h85f3911_1 conda-forge
h5py 3.9.0 pypi_0 pypi
idna 3.4 pypi_0 pypi
imageio 2.31.1 pypi_0 pypi
importlib-metadata 6.8.0 pypi_0 pypi
intel-openmp 2022.1.0 h9e868ea_3769
ipython 8.5.0 pypi_0 pypi
jedi 0.18.2 pypi_0 pypi
jpeg 9b h024ee3a_2
kiwisolver 1.4.4 pypi_0 pypi
lame 3.100 h7f98852_1001 conda-forge
ld_impl_linux-64 2.38 h1181459_1
libffi 3.3 he6710b0_2
libgcc-ng 11.2.0 h1234567_1
libgomp 11.2.0 h1234567_1
libiconv 1.17 h166bdaf_0 conda-forge
libpng 1.6.37 h21135ba_2 conda-forge
libstdcxx-ng 11.2.0 h1234567_1
libtiff 4.1.0 h2733197_1
libuv 1.43.0 h7f98852_0 conda-forge
lz4-c 1.9.3 h9c3ff4c_1 conda-forge
markdown 3.4.3 pypi_0 pypi
markdown-it-py 3.0.0 pypi_0 pypi
matplotlib 3.5.3 pypi_0 pypi
matplotlib-inline 0.1.6 pypi_0 pypi
mdurl 0.1.2 pypi_0 pypi
mkl 2022.1.0 hc2b9512_224
mmcv 1.3.0 pypi_0 pypi
mmcv-full 1.3.0 pypi_0 pypi
mmengine 0.8.2 pypi_0 pypi
mmsegmentation 0.11.0 pypi_0 pypi
model-index 0.1.11 pypi_0 pypi
ncurses 6.4 h6a678d5_0
nettle 3.6 he412f7d_0 conda-forge
ninja 1.11.0 h924138e_0 conda-forge
nose 1.3.7 pypi_0 pypi
numpy 1.23.2 pypi_0 pypi
olefile 0.46 pyh9f0ad1d_1 conda-forge
opencv-python 4.8.0.74 pypi_0 pypi
opencv-python-headless 4.8.0.74 pypi_0 pypi
opendatalab 0.0.9 pypi_0 pypi
openh264 2.1.1 h780b84a_0 conda-forge
openmim 0.3.9 pypi_0 pypi
openssl 1.1.1u h7f8727e_0
ordered-set 4.1.0 pypi_0 pypi
packaging 23.1 pypi_0 pypi
pandas 2.0.3 pypi_0 pypi
parso 0.8.3 pypi_0 pypi
pexpect 4.8.0 pypi_0 pypi
pickleshare 0.7.5 pypi_0 pypi
pillow 10.0.0 pypi_0 pypi
pip 23.1.2 py38h06a4308_0
platformdirs 3.9.1 pypi_0 pypi
prettytable 3.8.0 pypi_0 pypi
prompt-toolkit 3.0.39 pypi_0 pypi
ptyprocess 0.7.0 pypi_0 pypi
pure-eval 0.2.2 pypi_0 pypi
pycryptodome 3.18.0 pypi_0 pypi
pygments 2.15.1 pypi_0 pypi
pyparsing 3.1.0 pypi_0 pypi
python 3.8.13 haa1d7c7_1
python-dateutil 2.8.2 pypi_0 pypi
pytorch 1.9.0 py3.8_cuda11.1_cudnn8.0.5_0 pytorch
pytz 2023.3 pypi_0 pypi
pyyaml 6.0.1 pypi_0 pypi
readline 8.2 h5eee18b_0
requests 2.31.0 pypi_0 pypi
resnest 0.0.5 pypi_0 pypi
rfconv 0.0.2b20210406 pypi_0 pypi
rich 13.4.2 pypi_0 pypi
scipy 1.9.1 pypi_0 pypi
setuptools 67.8.0 py38h06a4308_0
six 1.16.0 pypi_0 pypi
sqlite 3.41.2 h5eee18b_0
stack-data 0.6.2 pypi_0 pypi
tabulate 0.9.0 pypi_0 pypi
termcolor 2.3.0 pypi_0 pypi
terminaltables 3.1.10 pypi_0 pypi
timm 0.6.7 pypi_0 pypi
tk 8.6.12 h1ccaba5_0
tomli 2.0.1 pypi_0 pypi
torchvision 0.10.0 py38_cu111 pytorch
tqdm 4.65.0 pypi_0 pypi
traitlets 5.9.0 pypi_0 pypi
typing_extensions 4.7.1 pyha770c72_0 conda-forge
tzdata 2023.3 pypi_0 pypi
urllib3 2.0.4 pypi_0 pypi
wcwidth 0.2.6 pypi_0 pypi
wheel 0.38.4 py38h06a4308_0
xz 5.4.2 h5eee18b_0
yapf 0.40.1 pypi_0 pypi
zipp 3.16.2 pypi_0 pypi
zlib 1.2.13 h5eee18b_0
zstd 1.4.9 haebb681_0
`

@RaymondWang987
Copy link
Owner

作者你好,我在复现您提供的github代码时出现了以下的报错,似乎和mmcv-full有关,我是通过pip install mmcv-full==1.3.0 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html以及pip install mmcv-full==1.3.0都尝试过,但都是这个报错。请问有什么解决方法吗,以下是报错信息: (NVDS) qjc@omnisky:/data3/qjcnerf/NVDS$ CUDA_VISIBLE_DEVICES=0 python infer_NVDS_dpt_bi.py --base_dir ./demo_outputs/dpt_init/000423/ --vnum 000423 --infer_w 896 --infer_h 384 Traceback (most recent call last): File "infer_NVDS_dpt_bi.py", line 19, in from backbone import * File "/data3/qjcnerf/NVDS/backbone.py", line 15, in from mmseg.models.builder import BACKBONES File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/init.py", line 1, in from .backbones import * # noqa: F401,F403 File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/backbones/init.py", line 2, in from .fast_scnn import FastSCNN File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/backbones/fast_scnn.py", line 7, in from mmseg.models.decode_heads.psp_head import PPM File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/decode_heads/init.py", line 16, in from .point_head import PointHead File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmseg/models/decode_heads/point_head.py", line 6, in from mmcv.ops import point_sample File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmcv/ops/init.py", line 1, in from .bbox import bbox_overlaps File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmcv/ops/bbox.py", line 3, in ext_module = ext_loader.load_ext('_ext', ['bbox_overlaps']) File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/site-packages/mmcv/utils/ext_loader.py", line 11, in load_ext ext = importlib.import_module('mmcv.' + name) File "/data1/qjc_new/anaconda/envs/NVDS/lib/python3.8/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ModuleNotFoundError: No module named 'mmcv._ext' 以下是我的环境信息: `(NVDS) qjc@omnisky:/data3/qjcnerf/NVDS$ conda list packages in environment at /data1/qjc_new/anaconda/envs/NVDS:

Name Version Build Channel _libgcc_mutex 0.1 main _openmp_mutex 5.1 1_gnu addict 2.4.0 pypi_0 pypi asttokens 2.2.1 pypi_0 pypi attr 0.3.2 pypi_0 pypi backcall 0.2.0 pypi_0 pypi blas 1.0 mkl bzip2 1.0.8 h7f98852_4 conda-forge ca-certificates 2023.7.22 hbcca054_0 conda-forge certifi 2023.7.22 pypi_0 pypi charset-normalizer 3.2.0 pypi_0 pypi click 8.1.6 pypi_0 pypi colorama 0.4.6 pypi_0 pypi cudatoolkit 11.1.1 ha002fc5_10 conda-forge cycler 0.11.0 pypi_0 pypi decorator 5.1.1 pypi_0 pypi einops 0.4.1 pypi_0 pypi executing 1.2.0 pypi_0 pypi ffmpeg 4.3 hf484d3e_0 pytorch fonttools 4.41.1 pypi_0 pypi freetype 2.10.4 h0708190_1 conda-forge gmp 6.2.1 h58526e2_0 conda-forge gnutls 3.6.13 h85f3911_1 conda-forge h5py 3.9.0 pypi_0 pypi idna 3.4 pypi_0 pypi imageio 2.31.1 pypi_0 pypi importlib-metadata 6.8.0 pypi_0 pypi intel-openmp 2022.1.0 h9e868ea_3769 ipython 8.5.0 pypi_0 pypi jedi 0.18.2 pypi_0 pypi jpeg 9b h024ee3a_2 kiwisolver 1.4.4 pypi_0 pypi lame 3.100 h7f98852_1001 conda-forge ld_impl_linux-64 2.38 h1181459_1 libffi 3.3 he6710b0_2 libgcc-ng 11.2.0 h1234567_1 libgomp 11.2.0 h1234567_1 libiconv 1.17 h166bdaf_0 conda-forge libpng 1.6.37 h21135ba_2 conda-forge libstdcxx-ng 11.2.0 h1234567_1 libtiff 4.1.0 h2733197_1 libuv 1.43.0 h7f98852_0 conda-forge lz4-c 1.9.3 h9c3ff4c_1 conda-forge markdown 3.4.3 pypi_0 pypi markdown-it-py 3.0.0 pypi_0 pypi matplotlib 3.5.3 pypi_0 pypi matplotlib-inline 0.1.6 pypi_0 pypi mdurl 0.1.2 pypi_0 pypi mkl 2022.1.0 hc2b9512_224 mmcv 1.3.0 pypi_0 pypi mmcv-full 1.3.0 pypi_0 pypi mmengine 0.8.2 pypi_0 pypi mmsegmentation 0.11.0 pypi_0 pypi model-index 0.1.11 pypi_0 pypi ncurses 6.4 h6a678d5_0 nettle 3.6 he412f7d_0 conda-forge ninja 1.11.0 h924138e_0 conda-forge nose 1.3.7 pypi_0 pypi numpy 1.23.2 pypi_0 pypi olefile 0.46 pyh9f0ad1d_1 conda-forge opencv-python 4.8.0.74 pypi_0 pypi opencv-python-headless 4.8.0.74 pypi_0 pypi opendatalab 0.0.9 pypi_0 pypi openh264 2.1.1 h780b84a_0 conda-forge openmim 0.3.9 pypi_0 pypi openssl 1.1.1u h7f8727e_0 ordered-set 4.1.0 pypi_0 pypi packaging 23.1 pypi_0 pypi pandas 2.0.3 pypi_0 pypi parso 0.8.3 pypi_0 pypi pexpect 4.8.0 pypi_0 pypi pickleshare 0.7.5 pypi_0 pypi pillow 10.0.0 pypi_0 pypi pip 23.1.2 py38h06a4308_0 platformdirs 3.9.1 pypi_0 pypi prettytable 3.8.0 pypi_0 pypi prompt-toolkit 3.0.39 pypi_0 pypi ptyprocess 0.7.0 pypi_0 pypi pure-eval 0.2.2 pypi_0 pypi pycryptodome 3.18.0 pypi_0 pypi pygments 2.15.1 pypi_0 pypi pyparsing 3.1.0 pypi_0 pypi python 3.8.13 haa1d7c7_1 python-dateutil 2.8.2 pypi_0 pypi pytorch 1.9.0 py3.8_cuda11.1_cudnn8.0.5_0 pytorch pytz 2023.3 pypi_0 pypi pyyaml 6.0.1 pypi_0 pypi readline 8.2 h5eee18b_0 requests 2.31.0 pypi_0 pypi resnest 0.0.5 pypi_0 pypi rfconv 0.0.2b20210406 pypi_0 pypi rich 13.4.2 pypi_0 pypi scipy 1.9.1 pypi_0 pypi setuptools 67.8.0 py38h06a4308_0 six 1.16.0 pypi_0 pypi sqlite 3.41.2 h5eee18b_0 stack-data 0.6.2 pypi_0 pypi tabulate 0.9.0 pypi_0 pypi termcolor 2.3.0 pypi_0 pypi terminaltables 3.1.10 pypi_0 pypi timm 0.6.7 pypi_0 pypi tk 8.6.12 h1ccaba5_0 tomli 2.0.1 pypi_0 pypi torchvision 0.10.0 py38_cu111 pytorch tqdm 4.65.0 pypi_0 pypi traitlets 5.9.0 pypi_0 pypi typing_extensions 4.7.1 pyha770c72_0 conda-forge tzdata 2023.3 pypi_0 pypi urllib3 2.0.4 pypi_0 pypi wcwidth 0.2.6 pypi_0 pypi wheel 0.38.4 py38h06a4308_0 xz 5.4.2 h5eee18b_0 yapf 0.40.1 pypi_0 pypi zipp 3.16.2 pypi_0 pypi zlib 1.2.13 h5eee18b_0 zstd 1.4.9 haebb681_0 `

你好,这个应该是MMCV内部的报错,应该是你的环境没有配好。我的环境配置时间是很久之前了,当时也是参考mmseg官方的链接和说明配置的,并且mmseg和mmcv的库有时会出现一些接口的变化,所以并不了解你的问题出在哪。建议你可以在网上多查一下相关的报错信息。我们的代码是没有问题的,重新clone下来后在我们的服务器上跑都是正常的。

@lijie2160
Copy link

Should install mmcv-full.

@ray8828
Copy link

ray8828 commented Aug 13, 2023

Same problem, this is indeed the bigest issue for using this project

@RaymondWang987
Copy link
Owner

RaymondWang987 commented Aug 14, 2023

Same problem, this is indeed the bigest issue for using this project

For mmcv-full and mmseg, there are detailed instructions (installations step by step) in the official document of mmseg. If you still meet the problem after strictly following those instructions, you could search and refer to some blogs. I have searched No module named 'mmcv._ext' by Google and found lots of blogs with solutions, some of them present the same suggestions as @lijie2160 (mmcv-full but not mmcv).

Different servers have different environments and I cannot solve all your installation problems one by one. When I get time, I may also install the environment again on my server and report detailed steps in this issue. I am quite busy in these weeks. Others who succeed in the installation could also report your step in this issue and help the ones who cannot install.

@ray8828
Copy link

ray8828 commented Aug 14, 2023

I solved this issue (at least i can inference) by using the latest mmcv and mmsegmentation and modify the code in this repo, at least i guess for now the inference works with the latest mmcv 2.x

@TouqeerAhmad
Copy link

TouqeerAhmad commented Aug 24, 2023

@ray8828 Can you please advise what changes you had to make to get this repo working with MMCV. I have installed MMCV==2.0.1, and mmseg=1.1.1, and now see this error:

"AssertionError: MMCV==2.0.1 is used but incompatible. Please install mmcv>=1.3.17, <=1.5.0."

Earlier, I did had mmcv==1.3.0 as suggested by the author, but that did not work either, and it asked me to update my mmcv to >= 2.0 Dependency on mmcv and mmseg is a big hinderance in running this repo, author should revise the instructions. Unfortunately following the instructions strictly does not seem to resolve the issues.

@EninumXJ
Copy link

EninumXJ commented Aug 25, 2023

@TouqeerAhmad I met this issue before, but i have solved it now.
I think the key point is to match the version of mmcv-full, mmsegmentation, cuda and pytorch. For me, I use cuda 11.6 and pytorch 1.13.0, so I pip install mmcv-full==1.7.1 (i check the available version from this link: https://download.openmmlab.com/mmcv/dist/cu116/torch1.13/index.html), and pip install mmsegmentation==0.30.0. Finally it works.
BTW, I advise you to install mmcv-full==1.x.x, because some parts of mmcv have been removed after 2.0.0, like mmcv.runner used in this repository. (open-mmlab/mmcv#2216)

@RaymondWang987
Copy link
Owner

RaymondWang987 commented Aug 25, 2023

For the problems of @TouqeerAhmad, I agree with @EninumXJ. The key is to match the version of mmcv-full and mmsegmentation with the version of cuda and pytorch on your server. For instance, I have CUDA 11.1 and PyTorch 1.9.0 on my server, thus mmcv-full 1.3.x and mmseg 0.11.0 (as in our installation instructions) are compatible with my environment (confirmed by mmcv-full 1.3.x). Different servers adopt different Cuda versions. You should check the matching version of your own server on the official documents of mmcv and mmseg.

You can see different versions of mmcv-full on their official document and choose the compatible one for your environment.

截屏2023-08-25 21 06 33

@RaymondWang987
Copy link
Owner

RaymondWang987 commented Aug 25, 2023

@TouqeerAhmad. For mmcv-full and mmseg, their official documents provide detailed version-matching relations with CUDA and Pytorch. For example, the official documents of mmcv-full 1.3.x provide a detailed matching table as the screenshot below, along with generating the Linux installation command for your case. These are similar for all mmcv versions by choosing the version numbers on the mmcv documents. Thus, in my previous reply, I suggested that the installation of mmcv-full and mmseg should follow their official documents. If you can read and follow the detailed mmcv-full and mmseg documents, the installation seems to be easy. I can not specify the installation for all people, since different servers have different CUDA and Pytorch versions.

截屏2023-08-25 21 41 49

@RaymondWang987 RaymondWang987 changed the title ModuleNotFoundError: No module named 'mmcv._ext' ModuleNotFoundError: No module named 'mmcv._ext' (Installation Issues) Aug 25, 2023
@TouqeerAhmad
Copy link

Thank you both @EninumXJ @RaymondWang987!
This was very helpful. I was able to successfully run NVDS after properly setting up the requirements. I am just going to state my steps here, in case someone else stumbles upon similar issue.

I first verified the torch and cuda versions for one of my existing virtual environments using:

python -c 'import torch;print(torch.__version__);print(torch.version.cuda)'

which turned out to be 1.10.2 and 11.3 respectively. Then I installed mmcv_full by specifying my torch and cuda version via following:

pip install mmcv_full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10/index.html

and then the mmsgementation:

pip install mmsegmentation==0.30.0

It then complained about three packages one after the other; specifically I installed the following:

pip install attr
pip install einops
pip install ipython

after which I was able to successfully run NVDS on market_6 sequence.

@wmj142326
Copy link

wmj142326 commented Sep 5, 2023

作者的Readme在安装mmcv-full和mmsegmentation是错误的。

  • 我更换了cuda=11.3和pytorch=1.10的版本,使用了如下命令安装:
    conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge

  • mmcv-full使用了1.7.0的高版本:
    pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10/index.html

  • mmsegmentation使用了0.3.0的版本
    pip install mmsegmentation==0.30.0

然后我补充了一些库,运行我成功运行了!!!

@RaymondWang987
Copy link
Owner

作者的Readme在安装mmcv-full和mmsegmentation是错误的。

  • 我更换了cuda=11.3和pytorch=1.10的版本,使用了如下命令安装:
    conda install pytorch==1.10.0 torchvision==0.11.0 torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge
  • mmcv-full使用了1.7.0的高版本:
    pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10/index.html
  • mmsegmentation使用了0.3.0的版本
    pip install mmsegmentation==0.30.0

然后我补充了一些库,运行我成功运行了!!!

readme的版本在我的服务器上是没有问题的,你可以看前面的讨论,只要mmcv的版本和你的cuda版本适配就可以了,我们readme当中的mmcv版本和我服务器的cuda是适配的。至于每个人不同的cuda版本,那你就需要根据mmcv官网查询版本对应关系进行安装就可以了。每个人服务器的cuda都不一样,我不可能为每一个版本去指定命令,这个自己根据自己的版本查mmcv的官方文档就可以了。所以我们的readme讲的很清楚,我指定的版本是适配的我的cuda,也是我通过命令查询出来的实际环境的版本。而你当然可以根据你的cuda和mmcv的版本更新进行安装,满足官网的适配关系就没问题,mmcv这一年也做了很多的更新,但我report的就是我实际的版本。

@wmj142326
Copy link

wmj142326 commented Sep 5, 2023

作者的Readme在安装mmcv-full和mmsegmentation并不适合每一个人。

  • 我更换了cuda=11.3和PyTorch=1.10的版本,使用了如下命令安装: conda install pytorch==1.10.0 Torchvision==0.11.0 Torchaudio==0.10.0 cudatoolkit=11.3 -c pytorch -c conda-forge
  • mmcv-full使用了1.7.0的高版本: pip install mmcv-full==1.7.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.10/index.html
  • mmsegmentation使用了0.30.0的版本 pip install mmsegmentation==0.30.0

然后我补充了一些库,运行我成功运行了!!!

Readme的版本在我的服务器上是没有问题的,你可以看前面的讨论,只要mmcv的版本和你的cuda版本适配就可以了,我们readme当中的mmcv版本和我服务器的cuda是适配的。至于每个人不同的cuda版本,那你就需要根据mmcv官网查询版本对应关系进行安装就可以了。每个人服务器的cuda都不一样,我不可能为每一个版本去指定命令,这个自己根据自己的版本查mmcv的官方文档就可以了。所以我们的readme讲的很清楚,我指定的版本是适配的我的cuda,也是我通过命令查询出来的实际环境的版本。而你当然可以根据你的cuda和mmcv的版本更新进行安装,满足官网的适配关系就没问题,mmcv这一年也做了很多的更新,但我report的就是我实际的版本。

太感谢啦,不好意思,我的表达可能有误~这里只是记录一下我的解决方案,供后来者参考:), 奥利给!

@jorgemcgomes
Copy link

jorgemcgomes commented Sep 21, 2023

Same problem, this is indeed the bigest issue for using this project

FYI @ray8828 , after playing around with this project a bit, turns out that the model itself actually doesn't have any dependency on mmcv or mmseg.

I could get it to run (inference) with only torch, timm and einops as dependencies. And even these two seem relatively easy to remove. No model code changes really, just a lot of refactoring to remove all the unnecessary mmcv and project dependencies.

image

There seems to be a lot of bloat in the codebase (no offence) that was probably added for training and evaluation purposes, but is not actually used for model loading or inference. If I remember correctly, the only model code change I really had to do was replacing some mmseg.Resize operations with equivalent torch interpolate calls, which was a direct replacement.

It would be nice if the authors themselves @RaymondWang987 could offer this, as I believe it could greatly increase the adoption of this project.

@RaymondWang987
Copy link
Owner

RaymondWang987 commented Sep 21, 2023

Same problem, this is indeed the bigest issue for using this project

FYI @ray8828 , after playing around with this project a bit, turns out that the model itself actually doesn't have any dependency on mmcv or mmseg.

I could get it to run (inference) with only torch, timm and einops as dependencies. And even these two seem relatively easy to remove. No model code changes really, just a lot of refactoring to remove all the unnecessary mmcv and project dependencies.

image There seems to be a lot of bloat in the codebase (no offence) that was probably added for training and evaluation purposes, but is not actually used for model loading or inference. If I remember correctly, the only model code change I really had to do was replacing some mmseg.Resize operations with equivalent torch interpolate calls, which was a direct replacement.

It would be nice if the authors themselves @RaymondWang987 could offer this, as I believe it could greatly increase the adoption of this project.

Thanks for your information and your attention to our work.

Initially, to build our stabilization network, we leverage some codebases with cross-attention calculations based on mmcv and mmseg. Some of the bloat library import are inherited from those old codebases, while some are used for training. We will try to remove those bloat import later.

With some functions for attention calculations from the old codebases, the initial version of NVDS model itself contains some modules of mmseg (e.g., mmseg conv, if I remember correctly). However, we found that those mmseg conv modules (the early mmseg version in the last year) had some problems or bugs for data-parallel training of pytorch. Thus, we had replaced the mmseg conv modules to the equivalent pytorch modules. But at that time, some resize operations are ignored and left with mmseg, since they did not impact the training process.

Thanks a lot for reminding us and I will try to remove some bloat mmcv parts later. You are also encouraged to share your current code of NVDS by issues or pull requests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants