Commit Graph

44 Commits (08602a238508b70fe42e2018ecad42d24f18f938)

Author SHA1 Message Date
LeoXing1996 08602a2385
[Enhancement] Support save best based on multi metrics (#349)
* support save best based on multi metrics

* add unit test

* resolve bugs after rebasing

* revise docstring

* revise docstring

* fix as comment

* revise as comment
2022-08-08 20:17:17 +08:00
Mashiro 6bd548d8bb
[FIx] Logging time in LoggerHook.after_val_epoch has no effect (#376) 2022-07-20 16:51:11 +08:00
Mashiro 38e78d5549
[Fix] Fix ema hook and add unit test (#327)
* Fix ema hook and add unit test

* save state_dict of ema.module

save state_dict of ema.module

* replace warning.warn with MMLogger.warn

* fix as comment

* fix bug

* fix bug
2022-07-04 14:23:23 +08:00
LeoXing1996 d65350a9da
[Fix] Fix bug of not save-best in iteration-based training (#341)
* fix bug of not save-best in iteration-based training

* revise the unit test
2022-06-30 14:51:31 +08:00
Alex Yang 216521a936
[Feat] Support save best ckpt (#310)
* [Feat] Support save best ckpt

* reformat code

* rename function and reformat code

* fix logging info
2022-06-22 19:48:46 +08:00
Mashiro afeac1c098
[Feature]: support to dump result in LoggerHook.after_test_epoch (#321) 2022-06-22 19:10:58 +08:00
Alex Yang dceef1f66f
[Refactor] Refactor `after_val_epoch` to make it output metric by epoch (#278)
* [Refactor]:Refactor `after_val_epoch` to make it output metric by epoch

* add an option for user to choose the way of outputing metric

* rename variable

* reformat docstring

* add type alias

* reformat code

* add test function

* add comment and test code

* add comment and test code
2022-06-21 15:39:59 +08:00
Jiazhen Wang 7b55c5bdbf
[Feature] Support resume from Ceph (#294)
* support resume from ceph

* move func and refine

* delete symlink

* fix unittest

* perserve _allow_symlink and symlink
2022-06-17 10:37:19 +08:00
Mashiro 8b0c9c5f6f
[Fix] fix build train_loop during test (#295)
* fix build train_loop during test

* fix build train_loop during test

* fix build train_loop during test

* fix build train_loop during test

* Fix as comment
2022-06-13 21:23:46 +08:00
Mashiro f04fec736d
[Feature]: add base model, ddp model wrapper and unit test (#268)
* add base model, ddp model and unit test

* add unit test

* fix unit test

* fix docstring

* fix cpu unit test

* refine base data preprocessor

* refine base data preprocessor

* refine interface of ddp module

* remove optimizer hook

* add forward

* fix as comment

* fix unit test

* fix as comment

* fix build optimizer wrapper

* rebase main and fix unit test

* stack_batch support stacking ndim tensor, add docstring for merge dict

* fix lint

* fix test loop

* make precision_context effective to data_preprocessor

* fix as comment

* fix as comment

* refine docstring

* change collate_data output typehints

* rename to_rgb to bgr_to_rgb and rgb_to_bgr

* support build basemodel with built DataPreprocessor

* fix as comment

* fix docstring
2022-06-07 22:13:53 +08:00
RangiLyu ad965a5309
[Enhance] Enhance checkpoint meta info. (#279) 2022-06-07 18:48:50 +08:00
RangiLyu 70c4ea191f
[Refactor]: Modify val_interval and val_begin to be the attributes of TrainLoop. (#274)
* Modify val_interval and val_begin to be the attributes of TrainLoop.

* update doc

* fix lint

* type hint
2022-06-06 11:13:25 +08:00
Mashiro 3e3866c1b9
[Feature] Add optimizer wrapper (#265)
* Support multiple optimizers

* minor refinement

* improve unit tests

* minor fix

* Update unit tests for resuming or saving ckpt for multiple optimizers

* refine docstring

* refine docstring

* fix typo

* update docstring

* refactor the logic to build multiple optimizers

* resolve comments

* ParamSchedulers spports multiple optimizers

* add optimizer_wrapper

* fix comment and docstirng

* fix unit test

* add unit test

* refine docstring

* RuntimeInfoHook supports printing multi learning rates

* resolve comments

* add optimizer_wrapper

* fix mypy

* fix lint

* fix OptimizerWrapperDict docstring and add unit test

* rename OptimizerWrapper to OptimWrapper, OptimWrapperDict inherit OptimWrapper, and fix as comment

* Fix AmpOptimizerWrapper

* rename build_optmizer_wrapper to build_optim_wrapper

* refine optimizer wrapper

* fix AmpOptimWrapper.step, docstring

* resolve confict

* rename DefaultOptimConstructor

* fix as comment

* rename clig grad auguments

* refactor optim_wrapper config

* fix docstring of DefaultOptimWrapperConstructor

fix docstring of DefaultOptimWrapperConstructor

* add get_lr method to OptimWrapper and OptimWrapperDict

* skip some amp unit test

* fix unit test

* fix get_lr, get_momentum docstring

* refactor get_lr, get_momentum, fix as comment

* fix error message

Co-authored-by: zhouzaida <zhouzaida@163.com>
2022-06-01 18:04:38 +08:00
Zaida Zhou f1da9a1d7f
[Feature] Support multiple optimizers (#235)
* Support multiple optimizers

* minor refinement

* improve unit tests

* minor fix

* Update unit tests for resuming or saving ckpt for multiple optimizers

* refine docstring

* refine docstring

* fix typo

* update docstring

* refactor the logic to build multiple optimizers

* resolve comments

* ParamSchedulers spports multiple optimizers

* refine docstring

* RuntimeInfoHook supports printing multi learning rates

* resolve comments

* fix typo
2022-05-31 16:54:39 +08:00
RangiLyu 4705e1fe3d
[Enhance] Add RuntimeInfoHook to update runtime information. (#254)
* [Enhance] Add RuntimeInfoHook to update runtime information.

* move lr to runtime info

* docstring

* resolve comments

* update ut and doc
2022-05-26 14:35:37 +08:00
RangiLyu 11688507ba
[Fix] Fix some bugs in hooks and runner. (#242)
* [Fix] Fix some bugs in hooks and runner.

* fix markdown

* fix latex formula

* resolve comments
2022-05-20 17:18:24 +08:00
RangiLyu 0279ac2e8d
[Feature] Support EMA and SWA. (#239)
* [Feature] Support EMA and SWA.

* add ema hook

* add avg model ut

* add more unit tests

* resolve comments

* fix warmup ema

* rename

* fix comments

* add assert

* fix typehint

* add comments
2022-05-19 18:53:04 +08:00
RangiLyu e37f1f905b
[Refactor] Make loop-related attributes to be runner's properties. (#236)
* [Enhance] Make loop related attributes to be runner's properties.

* move iter and epoch to loop

* resolve comments
2022-05-18 22:35:10 +08:00
Mashiro 859f4d1580
[Fix] Fix some code and docstring in LogProcessor and LoggerHook (#213)
* fix logger hook

* fix to record multi-level logs, log train/a/b to a/b

* fix loggerhook json path

* fix uunit test

* change runner.train_dataloader to runner.train_loop.dataloader

* clean debug code

* refie comments and docstring

* fix unit test
2022-05-06 14:33:33 +08:00
Mashiro 5007825619
[Fix] change CheckPointHook before_run to before train (#214)
* change CheckPointHook before_run to before train

* using tmp_path in each checkpointhook test case
2022-05-05 20:08:07 +08:00
Mashiro e0d00c5bdd
[Fix] resolve conflict betweem adapt and main. (#198)
* [Docs] Refine registry documentation (#186)

* [Docs] Refine registry documentation

* reslove comments

* minor refinement

* Refine Visualizer docs (#177)

* Refine Visualizer docs

* update

* update

* update featmap

* update docs

* update visualizer docs

* [Refactor] Refine LoggerHook (#155)

* rename global accessible and intergration get_sintance and create_instance

* move ManagerMixin to utils

* fix as docstring and seporate get_instance to get_instance and get_current_instance

* fix lint

* fix docstring, rename and move test_global_meta

* rename LogBuffer to HistoryBuffer, rename MessageHub methods, MessageHub support resume

* refine MMLogger timestamp, update unit test

* MMLogger add logger_name arguments

* Fix docstring

* Add LogProcessor and some unit test

* update unit test

* complete LogProcessor unit test

* refine LoggerHook

* solve circle import

* change default logger_name to mmengine

* refactor eta

* Fix docstring comment and unitt test

* Fix with runner

* fix docstring

fix docstring

* fix docstring

* Add by_epoch attribute to LoggerHook and fix docstring

* Please mypy and fix comment

* remove \ in MMLogger

* Fix lint

* roll back pre-commit-hook

* Fix hook unit test

* Fix comments

* remove \t in log and add docstring

* Fix as comment

* should not accept other arguments if corresponding instance has been created

* fix logging ddp file saving

* fix logging ddp file saving

* move log processor to logging

* move log processor to logging

* remove current datalaoder

* fix docstring

* fix unit test

* add learing rate in messagehub

* Support output training/validation/testing message after iterations/epochs

* fix docstring

* Fix IterBasedRunner log string

* Fix IterBasedRunner log string

* Support parse validation loss in log processor

* [Enhancement] Add PolyParamScheduler, PolyMomentum and PolyLR (#188)

* [Enhancement] Add PolyParamScheduler, PolyMomentum and PolyLR

* min_lr -> eta_min, refined docstr

Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
Co-authored-by: Haian Huang(深度眸) <1286304229@qq.com>
Co-authored-by: Tong Gao <gaotongxiao@gmail.com>
2022-04-26 00:37:16 +08:00
ZwwWayne ae3b857480 Merge branch 'adapt' of github.com:open-mmlab/mmengine into adapt 2022-04-22 13:48:14 +08:00
Mashiro 82a313d09b
[Enhancement] Refine logging. (#148)
* rename global accessible and intergration get_sintance and create_instance

* move ManagerMixin to utils

* fix as docstring and seporate get_instance to get_instance and get_current_instance

* fix lint

* fix docstring, rename and move test_global_meta

* rename LogBuffer to HistoryBuffer, rename MessageHub methods, MessageHub support resume

* refine MMLogger timestamp, update unit test

* MMLogger add logger_name arguments

* Fix docstring

* change default logger_name to mmengine

* Fix docstring comment and unitt test

* fix docstring

fix docstring

* fix docstring

* Fix lint

* Fix hook unit test

* Fix comments

* should not accept other arguments if corresponding instance has been created

* fix logging ddp file saving

* fix logging ddp file saving

* fix docstring

* fix unit test

* fix docstring as comment
2022-04-21 19:12:10 +08:00
liukuikun 5f8f36e6a5
refactor visualization (#147)
* [WIP] add inline

* refactor vis module

* [Refactor] according review

* [Fix] fix comment

* fix some error

* Get sub visualizer be Visualizer.get_instance

* fix conflict

* fix lint

* fix unit test

* fix mypy

* fix comment

* fix lint

* update docstr

* update

* update instancedata

* remove replace __mro__ with issubclass

Co-authored-by: PJLAB\huanghaian <1286304229@qq.com>
Co-authored-by: HAOCHENYE <21724054@zju.edu.cn>
2022-04-15 15:56:06 +08:00
Mashiro 605e78be82
Haochenye/fix logging (#167)
* remove LoggerHook master_only

* remogve \t in log string

* fix lint

* Fix lint
2022-04-12 21:50:30 +08:00
RangiLyu 59cc08e3ac
[Refactor] Refactor data_batch type and remove cur_dataloader in runner. (#171)
* [Refactor] Refactor data_batch type.

* fix sampler

* [Refactor] Remove cur_dataloader in runner.

* fix set_epoch
2022-04-08 15:57:10 +08:00
liukuikun 7e246b6f65
[Enhancement] refactor base data element (#143)
* [Enhancement] refactor base data elment

* fix comment

* fix comment

* fix pop not existing key without error
2022-03-31 18:21:45 +08:00
RangiLyu 9a61b389e7
[Refactor] Add batch_idx to hook input. (#140)
* [Refactor] Add batch_idx to hook input.

* update
2022-03-29 11:40:38 +08:00
Yuan Liu 26f24296db
[Feature]: Add dist semantics in checkpoint hook (#131)
* [Feature]: Add dist semantics in checkpoint hook

* [Fix]: Delete sync buffer in checkpoint hook
2022-03-25 13:46:31 +08:00
Mashiro a7961407e4
[Refactor] Refactor the interfaces of Hook and its subclassed (#117)
* Fix hook

* Fix

* Fix docs

* FIx

* Fix

* Fix as comment

* update

* Fix hook

* Fix hook

* Fix hook

* Fix itertimerhook

* Fix iter_timer_hook

* Fix

* Fix

* fix logger hook

* Fix loggerhook

* update cur_dataloader

* Fix docstring

* Fix docstring

* Fix as commet

* Fix as commet

* Fix as comment

* rename is_last_epoch, enhance and add after_val before_val .etc

* fix typo in docstring

* remove resolved TODO

* refactor docstring
2022-03-13 16:48:09 +08:00
Yuan Liu 755f8b5b59
[Refactor]: Change scheduler to param_scheduler (#121)
* [Refactor]: Change scheduler to param_scheduler

* [Fix]: Fix UT of param scheduler hook

Co-authored-by: Your <you@example.com>
2022-03-12 10:47:06 +08:00
liukuikun 3e0c064f49
[Feature] NaiveVisualizationHook (#98)
* [WIP] testvisualizationhook

* add TestNaiveVisualizationHook

* fix comment

* unpad

* batch imdenormalize

* fix comment

* fix comment
2022-03-10 17:22:31 +08:00
Mashiro 2e4ae21f2b
Fix test_get_max_memory (#113) 2022-03-09 14:05:25 +08:00
Mashiro 6f69039ca9
[Feature] Add LoggerHook (#77)
* add logger hook

* update

* update

* update test

* update

* update test

* update

* update

* update

* update

* update

* Add logger hook

* Fix pre-commit

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment

* Fix bytes

* update

* Fix as comment

* Fix as comment

* Update runner

* Fix as comment

* Fix as comment

* Fix as comment

* Fix as comment
2022-03-08 16:10:30 +08:00
Yuan Liu be9971781e
[Fix]: Change the type of runner in docstring to Runner (#103)
* [Fix]: Change after inter and epoch to after train iter and epoch

* [Fix]: Add new UT to param scheduler hook

* [Fix]: Change the type of runner in docstring to Runner

Co-authored-by: Your <you@example.com>
2022-03-07 14:00:05 +08:00
Yifei Yang 149248ce52
[Feature] Add Sync Buffer Hook (#57)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* [Fix]: Add docstring and type hint for base hook

* add sync buffer hook

* update typing hint and docs

* fix lint

* fix mypy

* fix lint

* use mock from unittest

Co-authored-by: seuyou <3463423099@qq.com>
2022-03-03 17:13:43 +08:00
Yuan Liu cf239a2b17
[Feature]: Add checkpoint hook (#66)
* [Feature]: Add checkpoint hook

* [Fix]: Fix lint

* [Fix]: Delete redundant optional and give an example to our_dir

* [Feature]: Add test the last_ckpt in UT

* [Fix]: Fix docstring problem

* [Fix]: Add patch to UT

* [Feature]: Add Test case for by epoch
2022-03-02 22:01:58 +08:00
Yifei Yang 2448380339
use unittest mock (#71) 2022-03-02 21:53:40 +08:00
Yifei Yang 94ab45d07e
[Feature] Add empty cache hook (#58)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* [Fix]: Add docstring and type hint for base hook

* [Fix]: Add test case to not the last iter, inner_iter, epoch

* [Fix]: Add missing type hint

* [Feature]: Add Args and Returns in docstring

* [Fix]: Add missing colon

* [Fix]: Add optional to docstring

* [Fix]: Fix docstring problem

* [Fix]: Fix lint

* fix lint

* update typing and docs

* fix lint

* Update mmengine/hooks/empty_cache_hook.py

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

* Update mmengine/hooks/empty_cache_hook.py

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

* Update mmengine/hooks/empty_cache_hook.py

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

* Update tests/test_hook/test_empty_cache_hook.py

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

* fix lint

* fix comments

* remove test condition

Co-authored-by: seuyou <3463423099@qq.com>
Co-authored-by: Zaida Zhou <58739961+zhouzaida@users.noreply.github.com>
2022-03-02 14:04:41 +08:00
Yuan Liu 63a3af4f8c
[Feature]: Add optimizer hook (#70)
* [Feature]: Add optimizer hook

* [Fix]: Update docstring

* [Fix]: Add call with in UT
2022-03-01 17:42:15 +08:00
Yuan Liu ab31e1936e
[Feature]: Add param scheduler hook (#63)
* [Feature]: Add param scheduler hook

* [Fix]: update docstring and add assert_call to UT
2022-03-01 15:49:44 +08:00
Yuan Liu 2d3e91248c
[Feature]: Add sampler seed hook (#64)
* [Feature]: Add sampler seed hook

* [Fix]: Add call with to UT
2022-03-01 15:38:01 +08:00
Yifei Yang 1244e486ae
[Feature] Add Iter Timer Hook (#48)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* add iter timer hook

* update test

* [Fix]: Add docstring and type hint for base hook

* fix mypy

* improve doc coverage and merge main

Co-authored-by: seuyou <3463423099@qq.com>
2022-03-01 12:02:34 +08:00
Yuan Liu bc759e5550
[Feature]: Add base Hook (#47)
* [Feature]: Add Part3 of Hooks

* [Feature]: Add Hook

* [Fix]: Add docstring and type hint for base hook

* [Fix]: Add test case to not the last iter, inner_iter, epoch

* [Fix]: Add missing type hint

* [Feature]: Add Args and Returns in docstring

* [Fix]: Add missing colon

* [Fix]: Add optional to docstring

* [Fix]: Fix docstring problem

* [Fix]:typo

* [Fix]: Fix lint

Co-authored-by: Your <you@example.com>
2022-02-26 14:51:09 +08:00