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

ImportError: cannot import name 'Correlation' from 'mmcv.ops' #16

Closed
Z-XQ opened this issue Nov 17, 2021 · 5 comments
Closed

ImportError: cannot import name 'Correlation' from 'mmcv.ops' #16

Z-XQ opened this issue Nov 17, 2021 · 5 comments

Comments

@Z-XQ
Copy link

Z-XQ commented Nov 17, 2021

window10
cuda10.2
pytorch1.6
python3.7
mmcv1.1.5

my first try failed. is the version of mmcv too old?

error info:
ImportError: cannot import name 'Correlation' from 'mmcv.ops'

@MeowZheng
Copy link
Collaborator

Yes, it's too old. Please double-check prerequisites, and MMFlow needs MMCV 1.3.15+

@Z-XQ
Copy link
Author

Z-XQ commented Nov 17, 2021

Thanks for your relpy! I just built MMCV from source, and the version is 1.3.17 (newest). But I get the error info as following.

error info:
Traceback (most recent call last):
File "D:/code/PycharmProjects/mmflow-master/verify_install.py", line 12, in
from mmflow.apis import inference_model, init_model
File "D:\code\PycharmProjects\mmflow-master\mmflow\apis_init_.py", line 2, in
from .inference import inference_model, init_model
File "D:\code\PycharmProjects\mmflow-master\mmflow\apis\inference.py", line 8, in
from mmcv.ops import Correlation
File "d:\code\pycharmprojects\mmcv-master\mmcv\ops_init_.py", line 2, in
from .assign_score_withk import assign_score_withk
File "d:\code\pycharmprojects\mmcv-master\mmcv\ops\assign_score_withk.py", line 6, in
'ext', ['assign_score_withk_forward', 'assign_score_withk_backward'])
File "d:\code\pycharmprojects\mmcv-master\mmcv\utils\ext_loader.py", line 13, in load_ext
ext = importlib.import_module('mmcv.' + name)
File "C:\Users\Administrator.conda\envs\mmflow\lib\importlib_init
.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'mmcv._ext'

conda list:
cudatoolkit 10.2.89 h74a9793_1 https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
mmcv 1.3.17 dev_0
mmflow 0.1.0 dev_0
python 3.7.11 h6244533_0 defaults
pytorch 1.6.0 py3.7_cuda102_cudnn7_0 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
torchvision 0.7.0 py37_cu102 https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch
vc 14.2 h21ff451_1 defaults
vs2015_runtime 14.27.29016 h5e58377_2 defaults

@MeowZheng
Copy link
Collaborator

MeowZheng commented Nov 17, 2021

In this part, we have explained the cause of this problem.
image

In addition, please check out mmcv installation documents and make sure mmcv-full has been installed successfully.

@MeowZheng
Copy link
Collaborator

No further discussion

@Z-XQ
Copy link
Author

Z-XQ commented Nov 19, 2021

In this part, we have explained the cause of this problem. image

In addition, please check out mmcv installation documents and make sure mmcv-full has been installed successfully.

Thank you! I have solved this problem and wrote a blog to describe this.

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

2 participants