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

在mmcv的2.1.0版本中,没有mmcv.runner.utils这个文件夹了,要怎么使用mmcv.runner.utils.obj_from_dict导入数据呢? #3086

Open
snowofrainy opened this issue Apr 15, 2024 · 3 comments

Comments

@snowofrainy
Copy link

What is the feature?

Traceback (most recent call last):
File "tools/voc_eval_visualize.py", line 529, in
main()
File "tools/voc_eval_visualize.py", line 524, in main
test_dataset = mmcv.runner.utils.obj_from_dict(cfg.data.test, datasets)
AttributeError: module 'mmcv' has no attribute 'runner'

这是在我使用test_dataset = mmcv.runner.utils.obj_from_dict(cfg.data.test, datasets)来导入数据时,发现的问题,请问我需要怎么做才能从dict导入数据呢?

Any other context?

No response

@zhouzaida
Copy link
Member

zhouzaida commented Apr 16, 2024

你好,在 mmcv2.0 之后的版本,这个函数被舍弃了,如果你仍然想用这个函数,可以参考 https://github.com/open-mmlab/mmcv/blob/265531fa9fe9e071c7d80df549d680ed257d9a16/mmcv/runner/utils.py#L37。
另外,根据你的描述,可能你还在用 OpenMMLab1.0 版本的下游算法库,你可以考虑降低 mmcv 的版本,使用 mmcv<2.0 的版本,可以使用下面的命令:

pip install openmim
mim install "mmcv<2.0"

@snowofrainy
Copy link
Author

snowofrainy commented Apr 16, 2024

你好,在 mmcv2.0 之后的版本,这个函数被舍弃了,如果你仍然想用这个函数,可以参考 https://github.com/open-mmlab/mmcv/blob/265531fa9fe9e071c7d80df549d680ed257d9a16/mmcv/runner/utils.py#L37。 另外,根据你的描述,可能你还在用 OpenMMLab1.0 版本的下游算法库,你可以考虑降低 mmcv 的版本,使用 mmcv<2.0 的版本,可以使用下面的命令:

pip install openmim
mim install "mmcv<2.0"

你好,我想请问一下,如果我降低mmcv的版本,会对我使用mmdetection产生影响吗?
image
我想使用该算法来绘制voc数据集的pr曲线,和分析它的result.pkl文件。除此之外,我还有其他的方法来绘制该曲线吗?

@zhouzaida
Copy link
Member

从你提供的版本信息可以知道,你使用的 mmdet>=3.0,这意味着你在使用 OpenMMLab2.0 版本,该版本要求 mmcv>=2.0,所以不能降低版本,会影响 mmdet 的使用

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