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

[Bug] Compatibility issues with installation of mmcv #3168

Closed
2 tasks done
Liumucan opened this issue Aug 20, 2024 · 1 comment
Closed
2 tasks done

[Bug] Compatibility issues with installation of mmcv #3168

Liumucan opened this issue Aug 20, 2024 · 1 comment

Comments

@Liumucan
Copy link

Prerequisite

Environment

PyTorch==2.4.0+cu124
MMCV==2.2.0

Reproduces the problem - code sample

I'm facing a problem with the installation of mmcv on my system. I'm trying to run a project that requires an older version of mmcv (1.3.18), but when I install this version, I will meet the incompatible like follows:
AssertionError: MMCV==1.3.16 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0.
Then, I follow this instruction to install higher version mmcv (i.e., 2.0.0rc4). However, there is a issue that the project code are significantly different between the older and newer versions of mmcv. Many of the modules that were previously imported from mmcv are now either removed or moved to a different location, causing compatibility issues. I've tried to find information on how to import these modules from the newer version of mmcv, but I've only found details on how to import some modules from mmengine. However, there are still many modules that I'm unable to import. The following are the modules I'd like to import:

import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, load_checkpoint,
                         wrap_fp16_model)
from mmdet.datasets import (build_dataloader, build_dataset,
                            replace_ImageToTensor)
from mmdet.models import build_detector

There seems to be no comprehensive document to introduce how we can use these modules in the new version of mmcv.
Could you please provide suggestions about how should I deal with this problem?

Reproduces the problem - command or script

import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.cnn import fuse_conv_bn
from mmcv.parallel import MMDataParallel, MMDistributedDataParallel
from mmcv.runner import (get_dist_info, init_dist, load_checkpoint,
                         wrap_fp16_model)
from mmdet.datasets import (build_dataloader, build_dataset,
                            replace_ImageToTensor)
from mmdet.models import build_detector

Reproduces the problem - error message

Traceback (most recent call last):
  File "test.py", line 27, in <module>
    from mmcv import Config, DictAction
ImportError: cannot import name 'Config' from 'mmcv' (/home/user10/.conda/envs/fashion_former2/lib/python3.8/site-packages/mmcv/__init__.py)

Additional information

No response

@Liumucan Liumucan changed the title [Bug] Compatibility issues with inslattion of mmcv [Bug] Compatibility issues with installation of mmcv Aug 20, 2024
@Liumucan
Copy link
Author

I have changed the CUDA version to meet the requirement of the lower version mmcv.

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

1 participant