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

Remove runner, parallel, engine and device #2216

Merged
merged 3 commits into from
Aug 22, 2022
Merged

Conversation

zhouzaida
Copy link
Collaborator

@zhouzaida zhouzaida commented Aug 19, 2022

Thanks for your contribution and we appreciate it a lot. The following instructions would make your pull request more healthy and more easily get feedback. If you do not understand some items, don't worry, just make the pull request and seek help from maintainers.

Motivation

Remove training-related modules because they have been re-implemented in mmengine.

Modification

Remove the following modules

  • mmcv/device
  • mmcv/engine
  • mmcv/parallel
  • mmcv/runner
  • mmcv/model_zoo

BC-breaking (Optional)

Yes

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

Before PR:

  • I have read and followed the workflow indicated in the CONTRIBUTING.md to create this PR.
  • Pre-commit or linting tools indicated in CONTRIBUTING.md are used to fix the potential lint issues.
  • Bug fixes are covered by unit tests, the case that causes the bug should be added in the unit tests.
  • New functionalities are covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  • The documentation has been modified accordingly, including docstring or example tutorials.

After PR:

  • If the modification has potential influence on downstream or other related projects, this PR should be tested with some of those projects, like MMDet or MMCls.
  • CLA has been signed and all committers have signed the CLA in this PR.

@Aismart20170718
Copy link

from mmcv.parallel import collate, scatter
where is collate, scatter now?

@Learneruestc
Copy link

from mmcv.parallel import collate, scatter where is collate, scatter now?

same problem... even I have changed mmcv to 1.4.0... messy version management

@WXX740813
Copy link

from mmcv.parallel import is_module_wrapper
from mmcv.utils import mkdir_or_exist
from mmcv.runner import get_dist_info
from mmcv.utils import get_logger
How to use these modules in the new version

@reesekneeland
Copy link

Do collate and scatter even exist now? This is extremely poor practice to remove functionality without specifying where it was moved to.

@HAOCHENYE
Copy link
Collaborator

No. ModelWrapper related modules and collate_fn have been moved to MMEngine.

@GalileoC
Copy link

So, where is the parallel in MMEngine, How to use it?

@migoxia
Copy link

migoxia commented Oct 5, 2023

from mmcv.runner import load_checkpoint
from mmcv.parallel import collate, scatter
How to use these modules in the new version?

@fanqiNO1
Copy link
Collaborator

fanqiNO1 commented Oct 7, 2023

So, where is the parallel in MMEngine, How to use it?

MMDistributedDataParallel can be found at https://github.com/open-mmlab/mmengine/blob/main/mmengine/model/wrappers/distributed.py.

@fanqiNO1
Copy link
Collaborator

fanqiNO1 commented Oct 7, 2023

from mmcv.runner import load_checkpoint from mmcv.parallel import collate, scatter How to use these modules in the new version?

load_checkpoint can be found at https://github.com/open-mmlab/mmengine/blob/main/mmengine/runner/checkpoint.py

collate and scatter has been removed.

@msseibel
Copy link

msseibel commented Oct 10, 2023

Where is MMDataParallel?

Further,
the advanced_guide still links to mmcv.parallel for DataContainer.

Where is DataContainer or an alternative thing?

@fanqiNO1
Copy link
Collaborator

MMDataParallel has been removed.

For DataContainer, mmengine.BaseDataElement has the similar function.
https://github.com/open-mmlab/mmengine/blob/53474ef1ba0b166508c231fa525b55b580adf20f/mmengine/structures/base_data_element.py#L9

@FlashToTrap
Copy link

FlashToTrap commented Oct 12, 2023

from mmcv.runner import get_dist_info, init_dist, set_random_seed
How to use these modules in 2.0.1 mmcv?

@fanqiNO1
Copy link
Collaborator

from mmcv.runner import get_dist_info, init_dist, set_random_seed How to use these modules in the new version?

These modules has been moved from mmcv to mmengine.

get_dist_info: https://github.com/open-mmlab/mmengine/blob/main/mmengine/dist/utils.py#L365

init_dist: https://github.com/open-mmlab/mmengine/blob/main/mmengine/dist/utils.py#L55

set_random_seed: https://github.com/open-mmlab/mmengine/blob/main/mmengine/runner/utils.py#L47

@migoxia
Copy link

migoxia commented Oct 14, 2023

from mmcv.runner import load_checkpoint from mmcv.parallel import collate, scatter How to use these modules in the new version?

load_checkpoint can be found at https://github.com/open-mmlab/mmengine/blob/main/mmengine/runner/checkpoint.py

collate and scatter has been removed.

So where are they removed to?

@dys-master
Copy link

from mmcv.runner import DistEvalHook as _DistEvalHook
from mmcv.runner import EvalHook as _EvalHook
请问这一部分还存在吗,如果在,我应该在哪里找到

@fanqiNO1
Copy link
Collaborator

from mmcv.runner import load_checkpoint from mmcv.parallel import collate, scatter How to use these modules in the new version?

load_checkpoint can be found at https://github.com/open-mmlab/mmengine/blob/main/mmengine/runner/checkpoint.py
collate and scatter has been removed.

So where are they removed to?

Sorry, they are deleted.

@fanqiNO1
Copy link
Collaborator

from mmcv.runner import DistEvalHook as _DistEvalHook from mmcv.runner import EvalHook as _EvalHook 请问这一部分还存在吗,如果在,我应该在哪里找到

它们也被删除了,但是大多数的功能被移至了 mmengine.hooks.checkpoint_hook.CheckpointHook 您可以参考 https://github.com/open-mmlab/mmengine/blob/main/mmengine/hooks/checkpoint_hook.py

@dys-master
Copy link

请问from mmcv.utils import get_logger是否也已经删除了呢

@fanqiNO1
Copy link
Collaborator

请问from mmcv.utils import get_logger是否也已经删除了呢

是的,它也被删除了

@dys-master
Copy link

请问from mmcv.utils import get_logger是否也已经删除了呢?

是的,它也被删除了

请问它的功能被转移到什么地方了呢

@fanqiNO1
Copy link
Collaborator

请问from mmcv.utils import get_logger是否也已经删除了呢?

是的,它也被删除了

请问它的功能被转移到什么地方了呢

或许您可以在 https://github.com/open-mmlab/mmengine/blob/main/mmengine/logging/logger.py 获得帮助。

@dys-master
Copy link

请问from mmcv.utils import get_logger是否也已经删除了呢?

是的,它也被删除了

请问它的功能被转移到什么地方了呢

您或许可以在https://github.com/open-mmlab/mmengine/blob/main/mmengine/logging/logger.py获得帮助。

谢谢

@qjt-1122
Copy link

where is ''mmcv.runner import auto_fp16, force_fp32'' now

@yasar-rehman
Copy link

yasar-rehman commented Nov 27, 2023

Hello! @fanqiNO1 @HAOCHENYE

Where can I find "obj_from_dict" in mmcv version 2.1.0? I cannot find it in mmengine? Is it being replaced by some equivalent function?

Additionally, where can I find "OptimizerHook"?

Thanks

@mxjjk
Copy link

mxjjk commented Nov 27, 2023

请问from mmcv.utils import get_logger是否也已经删除了呢?

是的,它也被删除了

请问它的功能被转移到什么地方了呢

您或许可以在https://github.com/open-mmlab/mmengine/blob/main/mmengine/logging/logger.py获得帮助。

谢谢

你好,请问您有遇到调用"from mmcv.utils import get_logger" 报错 ”cannot import name 'get_logger' from 'mmcv.utils'“的问题吗?如果有的话想问下您最后有解决吗?

@taiwuyouxu
Copy link

你好,请问“from mmcv.runner import force_fp32”移动到哪里去了呢,还有“from mmdet.core import (distance2bbox, multi_apply, reduce_mean, bbox2result, bbox_overlaps)”移动到哪里去了呢?

@fanqiNO1
Copy link
Collaborator

mmcv.runner import auto_fp16, force_fp32'

Sorry, obj_from_dict has been removed. For OptimizerHook, you can refer to ParamSchedulerHook in mmengine.

https://github.com/open-mmlab/mmengine/blob/main/mmengine/hooks/param_scheduler_hook.py#L13C7-L13C25

@goldentimecoolk
Copy link

你好,请问之前的

from mmcv.runner import OPTIMIZER_BUILDERS, DefaultOptimizerConstructor

from mmdet.utils import get_root_logger

在新版本中该如何引用?

@Tommy-shelby-github
Copy link

how should I use
from mmcv.runner.fp16_utils import wrap_fp16_model
in the new version?

@LinZiMu1
Copy link

how should I use

in the new version?from mmcv.runner import BaseModule

@OrangeSodahub
Copy link

Damn it, how can I find notes showing all the changes from mmcv to mmengine? The functions are removed, transferred, renamed ... It brings lots of trouble

@JasOleander
Copy link

versions are changed a lots without referencing anything such as migration information. What is wrong with you guys?
Whenever run, so messy about the version information such as mmcv, mmengine....

@prsbsvrn
Copy link

prsbsvrn commented Jun 18, 2024

Hi, have 'collate' and 'scatter' been removed? Can I find them somewhere else? In this link there is no replace for them.

@prsbsvrn
Copy link

I don't know how some GitHub projects still using these functions without any struggling. I spent 2 hour to fix the mismatch library of mmcv function and there is still some error to fix.

@foin6
Copy link

foin6 commented Jun 28, 2024

from mmcv.parallel import is_module_wrapper
from mmcv.utils import mkdir_or_exist
How to use these modules in mmcv2.0.0rc4?

@crystal0507
Copy link

from mmcv.parallel import collate, scatter
How to use these in mmcv2.1.0?

@crystal0507
Copy link

I don't know how some GitHub projects still using these functions without any struggling. I spent 2 hour to fix the mismatch library of mmcv function and there is still some error to fix.

I have the same question. Have you already solved it?

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

Successfully merging this pull request may close these issues.