Commit Graph

369 Commits (95d875832a228324999fc009aa89f42547a9a0c8)

Author SHA1 Message Date
Zaida Zhou cdec4cbd4a
[Fix] collate_fn does not support passing a function object (#1093) 2023-04-24 20:42:54 +08:00
shufan wu 2aef53d3fa
[Fix] No training log when the num of iterations is smaller than the interval (#1046) 2023-04-24 12:29:20 +08:00
Mashiro 4afed1332b
[Enhance] Visualizer.show supports calling opencv to show images (#1015)
* [Enhance] Enhance the efficiency of Visualizer.show

* Update unit test

* Simplify the logic of creating opencv window

* Update docstring

* Update unit test

* Update mmengine/visualization/visualizer.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-04-23 20:30:29 +08:00
cyberslack_lee 0687b377b2
[Enhancement] MessageHub.get_info() supports returning a default value (#991) 2023-04-23 17:35:35 +08:00
sjiang95 fafb476e58
[Feature] get_model_complexity_info() supports multiple inputs (#1065) 2023-04-23 16:11:31 +08:00
Mashiro 17c5414d16
[Fix] Fix the resuming error caused by HistoryBuffer (#1078) 2023-04-21 17:23:38 +08:00
Mashiro f1aca8e307
[Fix] Failed to remove the previous best checkpoints (#1086)
* [Fix] Only reserve one best checkpoint

* [Fix] Only reserve one best checkpoint

* Fix unit test

* shutdown logging

* clean the save_checkpoint logic
2023-04-20 21:28:56 +08:00
Mashiro be347df770
[Fix] KeyError is thrown in _collect_scalars when log_with_hierarchy is True (#1085)
* Fix log processor

* Fix custom key
2023-04-20 10:52:32 +08:00
Mashiro a7d4b7c742
[Enhance] Support configuring directory used to synchronize results in BaseMetric (#1074)
* [Enhance] Support configuring synchronize directory for BaseMetric

* Raise error if tmpdir is not an shared dirctory for ann ranks

* Raise error if tmpdir is not an shared dirctory for ann ranks

* Update mmengine/evaluator/metric.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* refine

* Update mmengine/evaluator/metric.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-04-14 19:15:04 +08:00
黄启元 60b4c199fc
[Feature] Support MLU backend (#1075)
* support mlu device

* support mlu device

* fix lint error

* fix lint error builder.py

* fix lint error in amp.py

* fix lint errors

* fix data type in instance_data.py
2023-04-14 19:06:19 +08:00
Qian Zhao b2ad2210b5
[Feature] Support registering partial functions and more (#595)
* support registering partial functions

* Update mmengine/registry/build_functions.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/registry/registry.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Revert unit test and refine

* add current logger and set log level

---------

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2023-04-10 19:42:04 +08:00
shufan wu 5e1ed7aaf0
[Enhance] Allow users to customize worker_init_fn of Dataloader (#1038)
* customize worker init fn function

* add assert

* narrow worker_init_fn type
2023-04-10 17:32:36 +08:00
sung-hwa kim 8bf1ecad38
[Feature] Add vis backend for MLflow. (#878)
* add vis mlflow backend
2023-04-07 16:35:41 +08:00
Mashiro 5762b28847
[Refactor] Refactor logger hook unit tests (#797)
* Enhance config

* add unit test data

* reafactor unittest of loggerhook

* fix rebase error

* Fix permission error in windows

* Fix CI

* Fix windows ci

* Fix windows ci

* Fix windows ci

* Fix windows CI

* Apply suggestions from code review

Co-authored-by: Qian Zhao <112053249+C1rN09@users.noreply.github.com>

* clean the code

* Refine as comment

* Refine error rasing

* Update mmengine/hooks/logger_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* replace assert_called_with with assert_has_calls

* Fix as comment

* Do not remove filehandler and fix unit test

---------

Co-authored-by: Qian Zhao <112053249+C1rN09@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-04-07 16:20:38 +08:00
Mashiro 2dbc8ed253
[Refactor] Refactor checkpointhook unit tests (#789)
* Enhance config

* add unit test data

* Refacotr unitest of checkpointhook

* add comments

* Fix unit test

* remove _get_metric_scope

* tmp save

* Revert "remove _get_metric_scope"

This reverts commit eeb7a8c5ed.

* Revert "Revert "remove _get_metric_scope""

This reverts commit 5398255f6f.

* Revert "tmp save"

This reverts commit cdc9919be8.

* clean the code

* Fix ut

* minor fix

* use str.replace
2023-04-06 10:55:16 +08:00
Mashiro dc931fd2c0
[Fix] Initialize nested modules in ddp which define 'init_weights' method (#1045) 2023-04-05 10:33:24 +08:00
zhouhui 093068e4ff
[Enhancement] Align the evaluation result in log (#1034)
* align the evaluation result in log

* align the evaluation result in log

* align the evaluation result in log

* align the evaluation result in log

* fix test log_processor
2023-04-04 00:17:42 +08:00
Mashiro 83c4f3e643
[Enhance] Make sure the FileHandler still alive after `torch.compile` (#1021)
* [Enhance] Make sure the FileHandler still alive after

* Resume filter

* avoid bc

* Fix unit test

* clean the code

* revert changes and set mode from 'm' to 'a'

* mode to file_mode

* add comments

* refine comments

* Fix duplicated the
2023-03-30 17:41:26 +08:00
Mashiro eb79d64af1
[Fix] Add PyTorch 2.0 CI and fix unit tests (#1026)
* [Enhance] Make sure the FileHandler still alive after

* minor refine

* minor refine

* refine unit test

* update CI

* update CI

* Fix CI

* fix build_windows

* fix build_windows

* fix build_windows

* fix build_windows

* debug

* debug

* debug

* debug

* debug

* debug

* debug

* test windows CI

* Fix

* Debug

* Fix unit test

* Fix unit test

* Fix CI

* update image version

* update action/checkout and action/setup-python

* add condition to skip test compile

* [Fix] Update CI and fix unit test

* check compiling by attempting compilation

* check compiling by attempting compilation

* check compiling by attempting compilation

* use windows-2022 in runs on

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update yml

* remove unnecessary assert

* assert grad is None according to the PyTorch version

* Fix code

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-03-29 13:09:23 +08:00
KerwinKai 5b35c5b6ad
[Feature] Publish models after training if published_keys is set in CheckpointHook (#987)
* add publish keys in checkpointhook and update hook.md file

* Update checkpoint_hook.py

To avoid `mypy` warning `mmengine/hooks/checkpoint_hook.py:358: error: Unsupported right operand type for in ("Optional[List[str]]") Found 1 error in 1 file (checked 224 source files)`

* Update hook.md

Try to avoid trim trailing whitespace waring in hook.md

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update checkpoint_hook.py

* Update docs/en/tutorials/hook.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update hook.md

add 自动发布最好的和最后的权重

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update checkpoint_hook.py

add condition when the best checkpoints more than 1.

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update checkpoint_hook.py

delete re judge

* Update checkpoint_hook.py

* Update checkpoint_hook.py

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update checkpoint_hook.py

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update checkpoint_hook.py

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Add Test for publish model

* Update checkpoint_hook.py

* Update test_checkpoint_hook.py

* Fix file to pass pre-commit check

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Fix mypy warning

* rm not necessary line in checkpoint_hook.py

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* rm unnecessary messages add to message_hub

* Update mmengine/hooks/checkpoint_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update docs/zh_cn/tutorials/hook.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update docs/zh_cn/tutorials/hook.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update checkpoint hook and hook.md file

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Update mmengine/hooks/checkpoint_hook.py

---------

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-03-29 10:25:14 +08:00
Mashiro d174952a3e
[Fix] Fix there is no space between data_time and metric (#1025) 2023-03-28 19:20:56 +08:00
Mashiro ad33a7d0e5
[Fix] Fix inferencer gets wrong configs path (#996)
* [Fix] Fix inferencer get wrong configs path

* Update CI

* Fix indent

* Fix CI arguments

* gpu test in CI

gpu test in CI

* require lint

* Adjust pytorch version and cuda version

* Fix docker

* Fix docker syntax

* Use bach -c

* Use bach -c

* Replace is_installed with is_imported

* Fix

* Fix PYTHONPATH
2023-03-14 18:28:33 +08:00
Mashiro 395ebf8d82
[Enhancement] Support dumping logs of different ranks (#968)
* Add hostname

* Update mmengine/logging/logger.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix lint

* support record device id

* Fix unit test

* Clean the code

* Fix as comment

* Fix as comment

* Fix unit test

* Update doc

* Fix unit test

* Adjust sequence

* Replace \ with ()

* remove unnecessary ()

* does not change filename in single gpu training

* Fix ci

* fix docs

* Fix as comment

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-03-13 14:35:31 +08:00
Mashiro 8063d2cce7
[Enhancement] Support writing data to `vis_backend` with prefix (#972)
* Log with prefix

* Fix test of loggerhook

* minor refine

* minor refine

* Fix unit test

* clean the code

* deepcopy in method

* replace regex

* Fix as comment

* Enhance readable

* rename reserve_prefix to remove_prefix

* Fix as comment

* Refine unit test

* Adjust sequence

* clean the code

* clean the code

* revert renaming reserve prefix

* Count the dataloader length in _get_dataloader_size
2023-03-13 13:07:37 +08:00
Qian Zhao 0d25625ba2
[Feature] Support torch.compile since PyTorch2.0 (#976)
* enable compile configurations to support torch.compile in Runner

* enable compilation in train, val and test

* fix as comments

* add docstring to illustrate usage

* minor refine error message

* add unittests

* fix ut skip

* add logging message to inform users

* compile `train_step`, `val_step`, `test_step` instead

* fix as comments

* revert to compile `train_step` only due to pt2 issue

* add documentation about torch.compile
2023-03-12 18:26:43 +08:00
Mashiro 6ea23a2f71
[Fix] Fix duplicated warning (#992)
* [Fix] Fix repeated warning

* Add type hint

* Fix unit test

* Rename recorder_dict to seen

* Fix as comment
2023-03-10 19:27:36 +08:00
Mashiro 7a074fa478
[Enhancement] Silence error when `ManagerMixin` built instance with duplicate name. (#990)
* [Fix]Silence error when ManagerMixin built duplicate name instance

* [Fix]Silence error when ManagerMixin built duplicate name instance

* Update mmengine/utils/manager.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-03-10 11:07:31 +08:00
Mashiro 8beacd3b58
[Fix] Support calculate the flops of `matmul` with single dimension matrix (#970)
* Support calculate the flops of matmul

* Remove unnecessary type ignore

* Update mmengine/analysis/jit_handles.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-03-09 17:29:26 +08:00
Mashiro 44f30f649e
[Enhancement] Add `FUNCTIONS` root Registry (#983)
* [Enhancement] Add FUNCTIONS Registry

* Refine as comment

* clean the code
2023-03-08 12:53:24 +08:00
Mashiro dbae83c52f
[Enhancement] Replace warnings.warn with print_log (#961)
* Replace warning with print_log

* Add comments for testing warning
2023-03-06 17:25:28 +08:00
Hakjin Lee b3430e4257
[Feature] Support EarlyStoppingHook (#739)
* [Feature] EarlyStoppingHook

* delete redundant line

* Assert stop_training and rename tests

* Fix UT

* rename `metric` to `monitor`

* Fix UT

* Fix UT

* edit docstring on patience

* Draft for new code

* fix ut

* add test case

* add test case

* fix ut

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Append hook

* Append hook

* Apply suggestions

* Update suggestions

* Update mmengine/hooks/__init__.py

* fix min_delta

* Apply suggestions from code review

* lint

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* delete save_last

* infer rule more robust

* refine unit test

* Update mmengine/hooks/early_stopping_hook.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: zhouzaida <zhouzaida@163.com>
Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2023-03-06 13:18:42 +08:00
Qian Zhao b1b1f53db2
[Fix] Fix optim_wrapper unittest for pytorch <= 1.10.0 (#975) 2023-03-02 14:14:23 +08:00
Qian Zhao 2ed8e343a0
[Feature] Enable bf16 in AmpOptimWrapper (#960)
* support bf16 in AmpOptimWrapper

* add docstring

* modify docs

* add unittests for bf16 in AmpOptimWrapper

* fix type

* fix to pass ci

* fix ut skip logic to pass ci

* fix as comment

* add type hints

* fix docstring and add warning information

* remove check for pytorch>=1.6 in unittest

* modify unittest

* modify unittest

* remove torch.float32 && torch.float64 from valid dtypes

* fix as comments

* minor refine docstring

* fix unittest parameterized to pass CI

* fix unittest && add back torch.float32, torch.float64
2023-03-01 21:35:18 +08:00
Zaida Zhou fc9518e2c1
[Feature] Add Lion optimizer (#952) 2023-02-23 11:24:50 +08:00
Zaida Zhou c94e7518e5
[Enhancement] Clear UT warning caused by pytest (#947)
* [Enhancement] Clear UT warning caused by pytest

* revert some changes for unittest

* revert

* update

* clear a numpy warning

* Update tests/test_visualizer/test_vis_backend.py

* fix a warning
2023-02-22 12:17:56 +08:00
Mashiro b14c179fad [Refactor] Refactor ema hook (#804)
* Refacot ema hook unit test

* Refacot ema hook unit test

* Enhance test_after_load_checkpoint

* refine error messsage

* Refine as comment

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

Fix unit test
2023-02-22 00:08:38 +08:00
Mashiro aa69ba1a86 [Refactor] Refactor unit test of ParamSchedulerHook (#809)
* Refactor unit test of param_schemeduler hook

* Refactor unit test of param_schemeduler hook
2023-02-22 00:08:38 +08:00
Mashiro 29f399441f [Refactor] Use a real runner to test RuntimeInfohook (#810)
* Refactor RuntimeInfoHook

* Fix as comment
2023-02-22 00:08:38 +08:00
Mashiro c4efda4186 [Refactor] Use a real runner to test DistSamplerSeedHook (#812)
* Refactor unit test of DistSamplerSeedHook

* rename the case

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-22 00:08:38 +08:00
Mashiro a094976e9f [Refactor] Use a real runner to test IterTimerHook (#807)
* Refactor iter_timer_hook

* Refactor iter_timer_hook
2023-02-22 00:08:38 +08:00
Mashiro 4b781c336b [Refactor] Refactor unit test of EmptyCacheHook (#805)
* test EmptyCacheHook with runner

* Add coments
2023-02-22 00:08:38 +08:00
Mashiro 425ca99e90 [Refactor] Refactor unit test of Base hook (#806)
* refactor base hooks

* Fix CI
2023-02-22 00:08:38 +08:00
luomaoling 3dc2be05d5
[Feature] Add NPUProfilerHook to profile performance in Ascend device (#925)
* Feature NPUProfilerHook

* Feature NPUProfilerHook
2023-02-21 17:20:40 +08:00
Zaida Zhou e16dacf7e3
Refine the repr of Registry (#942)
* Refine the repr of Registry

* fix ut

* fix ut
2023-02-21 13:18:11 +08:00
Songyang Zhang aee2f6a688
[Feature] Support model complexity computation (#779)
* [Feature] Add support model complexity computation

* [Fix] fix lint error

* [Feature] update print_helper

* Update docstring

* update api, docs, fix lint

* fix lint

* update doc and add test

* update docstring

* update docstring

* update test

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/print_helper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/analysis/complexity_analysis.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update docs/en/advanced_tutorials/model_analysis.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update docs/en/advanced_tutorials/model_analysis.md

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update docs

* update docs

* update docs and docstring

* update docs

* update test withj mmlogger

* Update mmengine/analysis/complexity_analysis.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update tests/test_analysis/test_activation_count.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update test according to review

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* fix lint

* fix test

* Apply suggestions from code review

* fix API document

* Update analysis.rst

* rename variables

* minor refinement

* Apply suggestions from code review

* fix lint

* replace tabulate with existing rich

* Apply suggestions from code review

* indent

* Update mmengine/analysis/complexity_analysis.py

* Update mmengine/analysis/complexity_analysis.py

* Update mmengine/analysis/complexity_analysis.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: zhouzaida <zhouzaida@163.com>
2023-02-20 15:00:28 +08:00
wxDai 1d97c07068
[Docs] Fix typo shedule (#936) 2023-02-19 20:44:24 +08:00
whcao a5f48f7d99
[Bug] Fix the bug when the params in shared modules do not require grad (#903)
* fix the bug when the params in shared modules do not require grad

* test DefaultOptimWrapperConstructor when the params in shared modules do not require grad
2023-02-15 11:25:15 +08:00
Eiuyc c59899a65a
[Enhance] Beautify the print result of the registry (#922)
* beautify the print result of the registry

* remove tabulate and use rich for repr

* remove table width; text align to left

* sort _model_dict items
2023-02-14 16:32:11 +08:00
xcnick e35ed5fd2e
[Feature] Add ApexOptimWrapper (#742)
* add ApexOptimWrapper

* typo fix

* add apex amp.initialize in optim_context

* assert apex_amp

* polish code

* add parameters of apex_amp.initialize

* add docs

* polish code

* polish code

* polish code

* fix calling of apex amp load_state_dict

* polish

* add comments

* Update apex_optimizer_wrapper.py

* Update apex_optimizer_wrapper.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-06 15:30:10 +08:00
takuoko d1d4609fa2
[Feature] Support using optimizers from dadaptation (#902)
* add dadaptation

* Update mmengine/optim/optimizer/builder.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* update dadaptation docs

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-03 15:00:32 +08:00
Mashiro 6dc1d7082a
[Fix] Support update np.ScalarType data in message_hub (#898)
* Clean the commit history

* Update message_hub.py

---------

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-02-01 23:53:28 +08:00
Zaida Zhou 5753cd98e0
[Fix] backend_args should not be modified by get_file_backend (#897) 2023-02-01 14:47:22 +08:00
jbwang1997 c46f891a97
[Enhance] Substitute the environment variable in config file (#744)
* Add read environment variable function in config

* Add UT

* enable int case, split predefined and environment

* Update py config

* Add new attributes env_variables in config

* Add examples in docstring

* Fix comments

* Add tutorials

* Add en tutorials

* Refactor config docs according to comments

* Fix comments

* Change function name
2023-02-01 10:16:47 +08:00
Mashiro 2d8f2be375
[Feature] Add BaseInferencer (#874)
* [Feature] Add BaseInferencer (#773)

* Update BaseInferencer

* Fix ci

* Fix CI and rename iferencer to infer

* Fix CI

* Add renamed file

* Add test file

* Adjust interface sequence

* refine preprocess

* Update unit test

Update unit test

* Update unit test

* Fix unit test

* Fix as comment

* Minor refine

* Fix docstring and support load image from different backend

* Support load collate_fn from downstream repos, refine dispatch

* Minor refine

* Fix lint

* refine grammar

* Remove FileClient

* Refine docstring

* add rich

* Add list_models

* Add list_models

* Remove backend args

* Minor refine

* Fix typos in docs and type hints (#787)

* [Fix] Add _inputs_to_list (#795)

* Add preprocess inputs

* Add type hint

* update api/infer in index.rst

* rename preprocess_inputs to _inputs_to_list

* Fix doc format

* Update infer.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* [Fix] Fix alias type (#801)

* [Enhance] Support loading model config from checkpoint (#864)

* first commit

* [Enhance] Support build model from weight

* minor refine

* Fix type hint

* refine comments

* Update docstring

* refine as comment

* Add  method

* Refine docstring

* Fix as comment

* refine comments

* Refine warning message

* Fix unit test and refine comments

* replace MODULE2PACKAGE to MODULE2PAKCAGE

* Fix typo and syntax error in docstring

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Tong Gao <gaotongxiao@gmail.com>
2023-01-16 16:01:06 +08:00
LEFTeyes 0b59a90a21
[Feature] Support ReduceOnPlateauParamScheduler(#819)
* [Feature] Add ReduceOnPlateauParamScheduler and change ParamSchedulerHook

* [Feature] add ReduceOnPlateauLR and ReduceOnPlateauMomentum

* pre-commit check

* add a little docs

* change position

* fix the conflict between isort and yapf

* fix ParamSchedulerHook after_val_epoch execute without train_loop and param_schedulers built

* Apply suggestions from code review

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* update ReduceOnPlateauParamScheduler, ReduceOnPlateauMomentum and ParamSchedulerHook

* fix get need_step_args attribute error in ParamSchedulerHook

* fix load_state_dict error for rule in ReduceOnPlateauParamScheduler

* add docs for ParamSchedulerHook and fix a few codes

* [Docs] add ReduceOnPlateauParamScheduler, ReduceOnPlateauMomentum and ReduceOnPlateauLR docs

* [Refactor] adjust the order of import

* [Fix] add init check for threshold in ReduceOnPlateauParamScheduler

* [Test] add test for ReduceOnPlateauParamScheduler, ReduceOnPlateauLR and ReduceOnPlateauMomentum

* [Fix] fix no attribute self.min_value

* [Fix] fix numerical problem in tests

* [Fix] fix error in tests

* [Fix] fix ignore first param in tests

* [Fix] fix bug in tests

* [Fix] fix bug in tests

* [Fix] fix bug in tests

* [Fix] increase coverage

* [Fix] fix count self._global_step bug and docs

* [Fix] fix tests

* [Fix] modified ParamSchedulerHook test

* Update mmengine/optim/scheduler/param_scheduler.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* [Fix] modified something according to commented

* [Docs] add api for en and zh_cn

* [Fix] fix bug in test_param_scheduler_hook.py

* [Test] support more complicated test modes(less, greater, rel, abs) for ReduceOnPlateauParamScheduler

* [Docs] add docs for rule

* [Fix] fix pop from empty list bug in test

* [Fix] fix check param_schedulers is not built bug

* [Fix] fix step_args bug and without runner._train_loop bug

* [Fix] fix step_args bug and without runner._train_loop bug

* [Fix] fix scheduler type bug

* [Test] rename step_args to step_kwargs

* [Fix] remove redundancy check

* [Test] remove redundancy check

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* [Test] fix some defects

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2023-01-16 11:39:03 +08:00
Ma Zerun fcd783fcb2
[Enhance] Support non-scalar type metric value. (#827)
* [Enhance] Support non-scalar type metric value.

* Refactor support.

* Fix non-scalar tags problem during validation

* Update tag processor.
2023-01-12 20:28:55 +08:00
Mashiro 925ac870e2
[Fix] Unloaded weights will not be initialized when using PretrainedIinit (#764)
* Separate init_cfgs to pretrained_cfg and other_cfgs

* Fix unit test

* update documentation

* Fix render of initialize.md

* Fix as comment

* rename initialize.md to weight_initialization.md

* add file

* fix ci

* rename weight_initialization.md to initialize.md

* Fix duplicated .md
2023-01-09 18:46:30 +08:00
Mashiro ad1b43faf2
[Fix] Fix `Config` cannot parse base config when there is `.` in tmp path (#856)
* [Fix] Fix config cannot parse tmp path like

* Add comments

* Add comments

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-12-30 14:56:14 +08:00
Zaida Zhou 646927f62f
[Enhance] Ensure metrics is not empty when saving best ckpts (#849)
* [Enhance] Ensure metrics is not empty when saving best ckpts

* fix warn to warning

* delete a unnecessary method
2022-12-28 11:34:08 +08:00
Mashiro a9b6753fbe
Make TTAModel compatible with FSDP (#611)
* Add build_runner_with_tta and PrepareTTAHook

* rename hook file

* support build tta runner with runner type

* add unit test

* Add build_runner_with_tta to index.rst

* minor refine

* Add runner test cast

* Fix unit test

* fix unit test

* tmp save

* pop None if key does not exist

* Fix is_model_wrapper and force register class in test_runner

* [Fix] Fix is_model_wrapper

* destroy group after ut

* register module in testcase

* pass through unit test

* fix as comment

* remove breakpoint

* remove mmengine/testing/runner_test_cast.py

* minor refine

* minor refine

* minor refine

* set default data preprocessor for model

* minor refine

* minor refine

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* fix lint

* Fix unit test

* replace  with  in ImgDataPreprocessor

* Fix as comment

* add inference tutorial in advanced tutorial

* update index.rst

* add tta example

* refine tta tutorial

* Add english tutorial

* add note for build_runner_with_tta

* Fix as comment

* add examples

* remove chinese comment

* Update docs/en/advanced_tutorials/test_time_augmentation.md

Co-authored-by: RangiLyu <lyuchqi@gmail.com>

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: RangiLyu <lyuchqi@gmail.com>
2022-12-27 21:39:43 +08:00
BayMax_BHL 16589ce386
[Feature] Add ProfilerHook (#768)
* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* [Feature] Add profiler hook functionality

* Apply suggestions from code review

* Update mmengine/hooks/profiler_hook.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-12-27 18:58:05 +08:00
Mashiro c382f8a5d5
[Fix] Ignore the distributed tests for macOS platform (#821)
* only test timer in linux

* Fix merge_stage_test.yml

* remove install ffmpeg

* test_ci

* test_ci

* Fix python -m pip install pip --upgrade to pip install

* don't test unittest with sleep 1 in windows

* debug with tmate

* increase timeout

* increase timeout

* skip test gloo

* skip test gloo

* fix synteax error

* skip test gloo in torch 1.13

* skip test gloo in torch 1.13

* skip testing setup_env in macOS

* skip test test_dist

* skip test setup

* restore triggered during push

* clean the code

* debug macos

* refine macOS CI

* test merge stage test

* trigger CI during push to main

* Fix as comment
2022-12-27 16:18:46 +08:00
RangiLyu e83ac944b6
[Feature] Registry supports import modules automatically. (#643)
* [Feature] Support registry auto import modules.

* update

* rebase and fix ut

* add docstring

* remove count_registered_modules

* update docstring

* resolve comments

* resolve comments

* rename ut

* fix warning

* avoid BC breaking

* update doc

* update doc

* resolve comments
2022-12-23 15:46:29 +08:00
Xiangxu-0103 591024e533
[Docs] Update docstring of structures (#840)
* Update docstring of `structures`

* update docs

* add `import torch` to `examples`
2022-12-21 20:07:18 +08:00
Zaida Zhou b44048aeb7
[Fix] Fix failed unit tests caused by the new released numpy (#838)
* [Fix] Fix failed unit tests caused by the new released numpy

* minor fix
2022-12-20 11:00:47 +08:00
Qian Zhao 4147e976a6
[Fix] ZeroRedundancyOptimizer ambiguous error with param groups when pytorch < 1.12.0 (#818)
* fix zero_optimizer error with param groups when pytorch < 1.12.0

* add docstring

* fix docstring

* add unittest

* change ut to use a valid paramwise_cfg

* modify ut

* fix as comments
2022-12-19 17:07:58 +08:00
RangiLyu 3582b4c787
[Enhance] Support setting decay multiplier for flatten parameter (#771)
* [Fix] Fix bias decay mult of depth-wise conv.

* support flatten param weight decay multiplier

* add unit tests

* REMOVE TODO

* update doc
2022-12-16 17:37:22 +08:00
Mashiro 95c71c82d0
[Fix] Only test Timer in Linux platform (#823) 2022-12-13 19:11:09 +08:00
Mashiro d876d4e0f8
[Enhance] Add support of TorchVision's Model Registration API (#793)
* enhance get_torchvision_model

* remove mmcv
2022-12-11 22:08:51 +08:00
Ma Zerun fe26c6559e
[Enhance] Support multiple `--cfg-options`. (#759) 2022-12-07 10:44:25 +08:00
Qian Zhao bd6791382f
[Fix] BaseModel & BaseDataPreprocessor `to` method to be consistent with torch.nn.Module (#783)
* fix BaseModel `to` method to be consistent with torch.nn.Module

* fix data_preprocessor as well

* fix docstring alignment

* fix docstring alignment
2022-12-05 18:04:47 +08:00
SUNYC 7e787d8ffa
[Enhance] Add a new parameter conf_path in PetrelBackend (#774)
* feat: add conf_path in PetrelBackend

* Update mmengine/fileio/backends/petrel_backend.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
2022-11-29 14:23:16 +08:00
liukuikun 5f58517069
[Enchance] remove redundant attributes in BaseDataElement (#690)
* remove redundant attribute in dump or print

* optimize efficiency

Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2022-11-24 21:36:19 +08:00
Mashiro ded73f3a56
[Enhance] Enhance compatibility of `revert_sync_batchnorm` (#695)
* [Enhance] Enhance revert_sync_batchnorm and convert_sync_batchnorm

* [Enhance] Enhance revert_sync_batchnorm and convert_sync_batchnorm

* Fix unit test

* Add coments

* Refine comments

* clean the code

* revert convert_sync_batchnorm

* revert convert_sync_batchnorm

* refine comment

* fix CI

* fix CI
2022-11-24 16:41:54 +08:00
cir7 0e6bb48b12
[Enhance] Support eta_min_ratio in CosineAnnealingParamScheduler (#725)
* [Enhance] support eta_min_ratio in CosineAnnealingParamScheduler

* [doc] fix docstring

* [Enhance] add ut for eta_min_ratio

* [doc] update docstring

* avoid bc-breaking of eta_min

* [doc] add docstring in CosineAnnealingParamScheduler and CosineAnnealingMomentum

* Apply suggestions from code review

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-11-22 20:19:16 +08:00
songyuc 6636f07cfe
[Feature] Add get_hooks_info() to print hooks messages (#672)
* Add test of get_hooks_info()

* Change to use original Runner for get_hook_info() test

* Change to test after_train_iter hooks for get_hook_info()

* Complement the stages list

* Add logging hooks information in Runner.__init__()

* Rearrange the stages list

* Restore the stages to tuple type

* Clean the unnecessary changes

* Replace  statement with TestCase's methods

* add test stages in method_stages_map

* change the hooks info into a f-string

* return list(trigger_stages) directly

* change keys of method_stages_map

* Fix previous changes to method_stages_map.keys
2022-11-22 20:02:29 +08:00
Mashiro b06234cfcd
[Enhance] Right align the log (#436)
* right allign the log

* fix as comment

* Add comments for magic number 3

* remove max_len_str

* Update mmengine/runner/log_processor.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-11-21 11:55:18 +08:00
Mashiro c478bdca27
[Enhance] enhance runner test case (#631)
* Add runner test cast

* Fix unit test

* fix unit test

* pop None if key does not exist

* Fix is_model_wrapper and force register class in test_runner

* [Fix] Fix is_model_wrapper

* destroy group after ut

* register module in testcase

* fix as comment

* minor refine

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* fix lint

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-11-21 11:54:05 +08:00
RangiLyu a9a575866f [Fix] Fix offline_evaluate index error (#630)
* [Fix] Fix offline eval dataset index error.

* update

* update
2022-11-18 01:17:12 +08:00
RangiLyu f2b0540f58 [Enhance] Raise warning for abnormal momentum (#655) 2022-11-18 01:17:12 +08:00
Yanhong Zeng 618a063ddc
[Docs] Fix docstring and documentation used for hub.get_model (#659)
* fix docstring and documentation used for hub.get_model

* fix config name in test_hub

* fix docstring mentioned faster-rcnn in utils
2022-11-02 10:16:56 +08:00
BigDong 376251961d
[Enhance] Add `ignore_keys` in ConcatDataset (#556)
* [Fix] Fix ConcatDataset error in VOCDataset

* minor fix

* minor fix

* minor fix

* add UT

* minor fix

* minor fix

* minor fix

* Update mmengine/dataset/dataset_wrapper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* minor fix

* Update mmengine/dataset/dataset_wrapper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-11-01 17:06:02 +08:00
Z-Fran 090104df21
[Fix] Fix the calculation error of eta_min in CosineRestart (#639)
* [Fix] fix CosineRestart eta_min

* add ut case

* Enhance unit test

Enhance unit test

* remove unused code

Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2022-11-01 15:48:39 +08:00
Mashiro d1dd240796
[Fix] Fix `BaseDataPreprocessor.cast_data` cound not handle string data (#602)
* [Fix] Fix  cound not handle string data

* Minor refine

* Refine type hint

Refine type hint

* fix as comment

* Minor refine

* Update mmengine/model/base_model/data_preprocessor.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-10-28 15:17:27 +08:00
Hakjin Lee 0857f9fb40
[Feature] Support torch ZeroRedundancyOptimizer (#551)
* [Feature] Support torch ZeRORedundancyOptimizer

Co-authored-by: Junhwa Song <ethan9867@gmail.com>
Signed-off-by: Junhwa Song <ethan9867@gmail.com>
Signed-off-by: Hakjin Lee <nijkah@gmail.com>

* lint

* Fix saving optimizer state_dict

* Fix handling import error

* Add test case

* fix UT

* Revert "fix UT"

This reverts commit dd64538960.

* fix handling import in UT

* Fix saving zero checkpoint and delete redundant master_only

* lint

* test unittest

* Fix handling impor error

* Fix UT condition

* Edit docstrings

* Fix typo

* Skip redundant procudure in checkpoint hook

* fix typo again

* Update mmengine/optim/optimizer/zero_optimizer.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Add api info

* lint

* Fix lint

* Handling AmpOptimWrapper case

* handling overlap_with_ddp

* Fix error

Signed-off-by: Junhwa Song <ethan9867@gmail.com>
Signed-off-by: Hakjin Lee <nijkah@gmail.com>
Co-authored-by: Junhwa Song <ethan9867@gmail.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-10-27 20:31:50 +08:00
Mashiro c1447734c2
[Enhance] Call `register_all_modules` in `Registry.get()` (#541)
* call register_all_modules  in Registry.get()

* Fix ci

* fix scope bug (scope_name -> scope), for temp sync

* Fix unit test

* Refine log information

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Fix typo

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-10-24 20:15:14 +08:00
Mashiro bda92b49e7
[Feature] Add a function to mark the deprecated function. (#609)
* [Enhancement] Add a deprecated function

* Refine and add ut

* tmp save

* minor refine

* Fix unit test

* Fix unit test

* fix docstring

* Update utils.rst
2022-10-24 14:49:48 +08:00
wangjiangben-hw 601db12d38
[Feature] Support engine with NPU backend. (#572)
* init npu

* Update mmengine/optim/optimizer/amp_optimizer_wrapper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/dist/dist.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* change to is_hccl_backend

* Update mmengine/optim/optimizer/amp_optimizer_wrapper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* add comment with AmpOptimWrapper

* Update mmengine/runner/amp.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/runner/amp.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* add npu fn in base_model

* Update mmengine/optim/optimizer/amp_optimizer_wrapper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* clean lint

* Update mmengine/optim/optimizer/amp_optimizer_wrapper.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/model/base_model/base_model.py

Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>

* add is_npu_available

* try to fix

* Add comments

* Refine grammar

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Mashiro <57566630+HAOCHENYE@users.noreply.github.com>
Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2022-10-24 11:42:29 +08:00
shenmishajing d270516fe8
[Fix]: fix add_config func is not called bug (#613)
* fix add_config func is not called bug
fix wandb add_config bug
add wandb log_code feature

* move log_code_name param to the last one
add log_code_name param to docstring

* add config only when there is a cfg

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* add unit test for log_code_name param of WandbVisBackend

* Update mmengine/visualization/vis_backend.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* use log_code_kwargs instead of only log_code_name
add PATH_FILTERS registry

* use log_code_kwargs instead of only log_code_name
add PATH_FILTERS registry

* fix add config unit test

* roll back to log_code_name version

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-10-24 09:58:10 +08:00
Mashiro aaba1d8871
[Fix] Fix error format of log message (#508)
* Fix error format of log message

* Fix unit test

* remove unnecessary comment
2022-10-18 18:04:15 +08:00
Mashiro abe56651db
[Fix] Make autocast compatible with mps (#587)
* [Fix] Make autocast compatible with mps

* Enhance unit test

* fix unit test

* clean the code

* fix unit test
2022-10-18 18:03:17 +08:00
Mashiro 6073d9ebd8
[Enhance] add documents for `clip_grad` , and support clip grad by value. (#513)
* [Enhance] add documents for , and support clip grad by value

* refine docstring

* fix as comment

* Fix as comment

* minor refine

* minor refine

* remove error comment for clip grad

* refine docstring
2022-10-18 18:02:46 +08:00
shenmishajing c2982723c9
[Feats]: add non_blocking feature to BaseDataPreprocessor (#618)
* add non_blocking feature to BaseDataPreprocessor

* Update mmengine/model/base_model/data_preprocessor.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* move new parameters to the last to avoid bc issue

* Update mmengine/model/base_model/data_preprocessor.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

* Update mmengine/model/base_model/data_preprocessor.py

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-10-18 17:58:51 +08:00
Mashiro 62456217f9
[Feature] Add test time augmentation base model. (#538)
* First commit

* add BaseTestTimeAugModel

* Add unit test

* move loop logic to test_step

* fix ddp test

* rename model to module

* optim __init__

* Fix as comment

* Fix as comment

* make val_step should not be called

* make tta do not inherit base model

* Fix unit test

* Enhance docstring

* Fix as comment

* Fix as comment

* minor refine

* minor refine

* minor refine

* fix unit test

* minor refine

* minor refine

* minor refine

* minor refine

* minor refine

* minor refine

* fix unit test
2022-10-10 14:29:33 +08:00
Qian Zhao e73c4bf135
[Fix] some out-of-date unittests (#586)
* fix dist ut

* fix config & hub ut break due to mmdet faster-rcnn rename
2022-10-08 19:48:51 +08:00
Mashiro 89146a5b90
[Fix] Fix detect_anomalous_params (#588) 2022-10-08 19:48:35 +08:00
Zaida Zhou ed84dfd34d
[Refactor] Refactor fileio without breaking back compatibility (#533)
* [Refactor] Refactor fileio but without breaking bc

* handle compatibility

* fix format

* modify io functions

* fix ut

* fix ut

* rename method names

* refine

* refine docstring

* fix ut in windows

* update ut

* minor fix

* ensure client is not None when closing it

* add more examples for list_dir_or_file interface

* refine docstring

* refine deprecated info

* fix ut

* add a description for lmdb docstring
2022-09-26 14:30:40 +08:00
Qian Zhao c64243aa9e
[Fix] CheckpointHook behavior incorrect if given `filename_tmpl` argument (#518) 2022-09-22 12:47:45 +08:00
Mashiro 5d7527d75e
[Fix ] Fix unit test could may fail caused by `MultiProcessTestCase` (#535)
* fix merge ci

* make timeout larger

* tmp test merge

* debug

* sleep 1 in optimizer ut

* skip test clip grad

* skip test clip grad

* fix merge ci
2022-09-15 18:08:56 +08:00
Mashiro 8ee31dbc3b
[Feature] Support convert `BN` to `SyncBN` by config (#506)
* [Feature] Support convert BN to SyncBN by config

* make unit test compatible with cpu

* Fix as comment

* fix unit test

* change signature of convert_sync_batchnorm: rename sync_bn to implemention

* fix unit test

* fix unit test
2022-09-15 18:08:36 +08:00