* Add gradient cumulative optimizer
fixes#190
* Update optimizer.py
* Update optimizer.py
* fix loss scale improperly in last equivalent_iter
* Add `GradientCumulativeOptimizerHook` in `__init__.py`.
* Add docstring of `GradientCumulativeOptimizerHook`.
* Add type check, BN warning and resume warning. And fix typo, lint the
code.
* Add unit test
* Update docstring example.
* Change GradientCumulativeOptimizerHook `__init__` arguments.
* Add GradientCumulativeOptimzierHook unit tests with IterBasedRunner.
* Add GradientCumulativeFp16OptimizerHook.
* Add unit tests of GradientCumulativeFp16OptimizerHook
* Use '!=' instead of '>' to determine resume
Co-authored-by: Zhiyuan Chen <this@zyc.ai>
* Support deprecation checking in Config
* add unittest for config deprecation
* support reference link in deprecation info
* add doc
* Update config.md
* [Fix] Fix the bug that training log and evaluating log are mixed
* [Fix] Fix the bug that training log and evaluating log are mixed
* fix comment
* fix import error
* refactor
* refactor
* refactor
* clear log_buffer before evaluation
* fix error
* add unittest
* improve digit_version & use it for version_checking
* more testing for digit_version
* setuptools >= 50 is needed
* fix CI
* add debuging log
* >= to ==
* fix lint
* remove
* add failure case
* replace
* fix
* consider TORCH_VERSION == 'parrots'
* add unittest
* digit_version do not deal with the case if 'parrots' in version name.
* add flat cosine lr updater
* add test
* add doc
* update doc
* reformat
* update unittest
* update test flat cos
* remove momentum hook test
* update test
* change assert to ValueError
* fix unittest
* add by_epoch=True unittest
* change to start_percent
* change to start_percent in test
* add torch.roll to onnx
* remove skip test
* add support to torch<170
* add dim=0 for torch==1.9.0
* update fixture function name, add comment in roll symbolic
* Add `is_tracing` to wrap `torch.jit.is_tracing` in different versions.
* Remame `is_tracing` to `is_jit_tracing`
* Ignore `is_jit_tracing` tests in CI.
* porting mmcv for hip
* add nvcc
* fix format
* fix format
* fix bug for carafe
* fix test_utils because rocm_torch not allow set torch.backends.cudnn.benchmark to false
* add LOOSEVERSION
* fix format
* fix format of version
* fix code format
* test for yaml
* fix bug for citest
* fix bug for how to get torch._version_ at setup.py
* Missing check for dir in the 'else' clause
Fixing issue when recursively scanning directories with filenames starting with '.' Without this fix, the `if not entry.name.startswith('.') and entry.is_file()` logic falls through to the `else` clause which in the current code base will error out as it encounters '.' files (e.g. .DS_Store)
* Updated code per comments
* fixing indentation
* fix indenterror and add comment
* remove .DS_Store and add .file
Co-authored-by: zhouzaida <zhouzaida@163.com>
* support print using hooks before running.
* Support to print hook trigger stages.
* Print stage-wise hook infos. And make `stages` as class attribute of
`Hook`
* Add util function `is_method_overriden` and use it in
`Hook.get_trigger_stages`.
* Add unit tests.
* Move `is_method_overriden` to `mmcv/utils/misc.py`
* Improve hook info text.
* Add base_class argument type assertion, and fix some typos.
* Remove `get_trigger_stages` to `get_triggered_stages`
* Use f-string.
* Support image reading while ignoring EXIF orientation info
Add unit test for ignore_orientation flags in imread()
* add documentation for imread
* Add test cases
* Refine default hooks and custom hooks priority rank.
* Add unit tests for custom hooks with string priority.
* Use priority `ABOVE_NORMAL` and `BELOW_NORMAL` instead of `HIGHER` and
`LOWER`.
And add unit tests for custom hook with the same priority as
default hooks.
* Support variables in base files for configs
Signed-off-by: lizz <lizz@sensetime.com>
* Test json and yaml as well
Signed-off-by: lizz <lizz@sensetime.com>
* Add test for recusive base
Signed-off-by: lizz <lizz@sensetime.com>
* Test misleading values
Signed-off-by: lizz <lizz@sensetime.com>
* Improve comments
Signed-off-by: lizz <lizz@sensetime.com>
* Add doc
Signed-off-by: lizz <lizz@sensetime.com>
* Improve doc
Signed-off-by: lizz <lizz@sensetime.com>
* More tests
Signed-off-by: lizz <lizz@sensetime.com>
* Harder test case
Signed-off-by: lizz <lizz@sensetime.com>
* use BASE_KEY instead of base
Signed-off-by: lizz <lizz@sensetime.com>
* minor changes
* change to modulist
* change to Sequential
* replace dropout with attn_drop and proj_drop in MultiheadAttention
* add operation_name for attn
* add drop path and move all ffn args to ffncfgs
* fix typo
* fix a bug when use default value of ffn_cfgs
* fix ffns
* add deprecate warning
* fix deprecate warning
* change to pop kwargs
* support register FFN of transformer
* support batch first
* fix batch first wapper
* fix forward wapper
* fix typo
* fix lint
* add unitest for transformer
* fix unitest
* fix equal
* use allclose
* fix comments
* fix comments
* change configdict to dict
* move drop to a file
* add comments for drop path
* add noqa 501
* move bnc wapper to MultiheadAttention
* move bnc wapper to MultiheadAttention
* use dep warning
* resolve comments
* add unitest:
* rename residual to identity
* revert runner
* msda residual to identity
* rename inp_identity to identity
* fix name
* fix transformer
* remove key in msda
* remove assert for key
Co-authored-by: HIT-cwh <2892770585@qq.com>
Co-authored-by: bkhuang <congee524@gmail.com>
Co-authored-by: Wenwei Zhang <40779233+ZwwWayne@users.noreply.github.com>
* Add score_threshold and max_num to NMS
* Fix codestyle
* Fix codestyle
* Fix inds in nms
* Update nms docstring
* Move score_threshold and max_num arguments
* Fix args order in docstring
* fix lint of c++ file
* Remove torch.onnx.is_in_onnx_export() and add max_num to batched_nms for separate classes.
* Rewrote max_num handling in NMSop.symbolic
* Added processing max_output_boxes_per_class when exporting to TensorRT
* Added score_threshold and max_num for NMS in test_onnx.py and test_tensorrt.py
* Remove _is_value(max_num)
* fix ci errors with torch==1.3.1
* Update test_batched_nms in test_nms.py
* Added tests for preprocess_onnx
* Moved 'test_tensorrt_preprocess.py' and 'preprocess', updated 'remove_tmp_file'.
* Update mmcv/tensorrt/__init__.py
* Fix segfault torch==1.3.1 (remove onnx.checker.check_model)
* Returned 'onnx.checker.check_model' with torch version check
* Changed torch version from 1.3.1 to 1.4.0
* update version check
* remove check for onnx
Co-authored-by: maningsheng <maningsheng@sensetime.com>
* fix fp16 bug on DCNv2
* support fp16 on DCN/DCNv2 when pytorch >= '1.6.0'
* add comment
* Modified the comments
* Unified the usages of '.to()' and '.type_as()'
* Assign different priority to default hooks, and add custom hook register in base runner.
* Add custom hook register in example train file
* Add unittest of custom hook
* Code format
* support custom op `mmcv::cummax` for onnxruntime in mmcv
* fix clang-format lint error
* support mmcv::cummin, reformat codes
* fix merge from master
* add docs for mmcv::cummax and mmcv::cummin
* format doc
* add assertion for torch version, when exporting `cummax` to onnx
* add more comments for torch version
* handle exporting to onnx in `soft_nms`
* commit for test_onnx
* remove `is_in_onnx_export` in softnms
* add more comments
* fix c++ lint error
* add known issues doc for `cummax`
* fix known issues doc
* supports for onnxruntime custom op `mmcv::MMCVTopPool`
* supports for onnxruntime custom op `mmcv::MMCVCornerPool`, involving TopPool, BottomPool, LeftPool and RightPool
* add unittest for corner_pool
* supports mmcv::CornerPool without memcpy
* add docs for mmcv::CornerPool
* re-add docs for mmcv::CornerPool
* fix output dtype doc
* reformat
* format with pre-commit
* format
* fix lint error, by using google clang-format style for c/c++
* support clipping min_lr in StepLrUpdaterHook
* add docstring for StepLrUpdaterHook
* fix small bugs
* add unit test for StepLrUpdaterHook
* fix linting error
* fix raise error bug in registering multiple names
* fix bug in checking the type of name
* fix lint
* fix unit test for registry
* fix bug in unit test