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

[WIP] Support LR_ReduceOnPlateau #1033

Closed
wants to merge 82 commits into from

Conversation

gengenkai
Copy link
Contributor

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

Please describe the motivation of this PR and the goal you want to achieve through this PR.

Modification

Please briefly describe what modification is made in this PR.

BC-breaking (Optional)

Does the modification introduce changes that break the back-compatibility of the downstream repos?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

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

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit test to ensure the correctness.
  3. If the modification has potential influence on downstream projects, this PR should be tested with downstream projects, like MMDet or MMCls.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CLAassistant
Copy link

CLAassistant commented May 19, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
31 out of 32 committers have signed the CLA.

✅ gengenkai
✅ ritosonn
✅ AronLin
✅ zhouzaida
✅ grimoire
✅ innerlee
✅ fcakyon
✅ luopeichao
✅ v-qjqs
✅ yinchimaoliang
✅ SemyonBevzuk
✅ RunningLeon
✅ MeowZheng
✅ LXXXXR
✅ ycxioooong
✅ DmitriySidnev
✅ jshilong
✅ cww97
✅ daavoo
✅ ly015
✅ jaemin93
✅ fjfzlzj
✅ dreamerlin
✅ Junjun2016
✅ xvjiarui
✅ kennymckormick
✅ mzr1996
✅ gaotongxiao
✅ achaiah
✅ RangiLyu
✅ antoniolanza1996
❌ liguankai


liguankai seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@codecov
Copy link

codecov bot commented May 21, 2021

Codecov Report

Merging #1033 (7140ee0) into master (b8c09f3) will increase coverage by 2.48%.
The diff coverage is 68.30%.

❗ Current head 7140ee0 differs from pull request most recent head f229de3. Consider uploading reports for the commit f229de3 to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1033      +/-   ##
==========================================
+ Coverage   65.30%   67.78%   +2.48%     
==========================================
  Files         154      159       +5     
  Lines        9891    10558     +667     
  Branches     1801     1935     +134     
==========================================
+ Hits         6459     7157     +698     
+ Misses       3099     3025      -74     
- Partials      333      376      +43     
Flag Coverage Δ
unittests 67.78% <68.30%> (+2.48%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
mmcv/cnn/__init__.py 100.00% <ø> (ø)
mmcv/cnn/utils/__init__.py 100.00% <ø> (ø)
mmcv/cnn/utils/flops_counter.py 93.63% <ø> (ø)
mmcv/image/__init__.py 100.00% <ø> (ø)
mmcv/image/photometric.py 99.26% <ø> (ø)
mmcv/ops/bbox.py 15.00% <ø> (ø)
mmcv/ops/fused_bias_leakyrelu.py 30.90% <ø> (ø)
mmcv/ops/merge_cells.py 96.72% <ø> (ø)
mmcv/ops/modulated_deform_conv.py 48.30% <0.00%> (-2.14%) ⬇️
mmcv/ops/pixel_group.py 100.00% <ø> (ø)
... and 67 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8c09f3...f229de3. Read the comment docs.

AronLin and others added 7 commits May 23, 2021 15:16
* fix generalized attention fp16

* fix building without gpu error

* add comment

* Cast tensor at initialization
* add neptune.ai logger hook

* add docstring

* move docstring

* update docstr

* update before_run
… on DCN/DCNv2 amp (open-mmlab#1029)

* 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()'
* [Feature] Add truncated normal weight init

* [Feature] Add truncated normal weight init

* [Feature] Add truncated normal weight init

* update docstring

* delete modelA.pth

* modify according to comment

* use kstest to check truncated normal

* delete modelA.pth

* fix test.txt
* add cummax/cummin tensorrt plugin

* fix isort

* fix with clang-format

* fix with clang-format again

* add document
* Fix typos

Signed-off-by: lizz <[email protected]>

* Add deprecation warning

Signed-off-by: lizz <[email protected]>
@gengenkai gengenkai changed the title [Feature] Support LR_ReduceOnPlateau [WIP] Support LR_ReduceOnPlateau May 24, 2021
gengenkai and others added 7 commits May 25, 2021 11:57
* support cuda version `BorderAlign` module

* fix symbolic

* merge

* fix cpp lint error

* add unit test

* add comments for code references

* reformat doc

* fix lint error

* fix conflict
* add instancenorm plugin

* resolve comments

* fix lint

* fix typo
@zhouzaida zhouzaida mentioned this pull request May 26, 2021
11 tasks
eps=1e-8,
**kwargs):
if isinstance(periods, list):
assert mmcv.is_list_of(periods, int)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should add arguments like assert expression [, arguments]

class ReduceLrUpdateHook(LrUpdaterHook):

def __init__(self,
periods,
Copy link
Collaborator

@zhouzaida zhouzaida May 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add type hint for arguments

raise TypeError('"periods" must be a list')
self.periods = periods
self.val_metric = val_metric
if mode not in ['min', 'max']:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is readable to add a blank line between different logical code

elif self.mode == 'max' and self.threshold_mode == 'rel':
rel_epsilon = 1. + self.threshold
return a > best * rel_epsilon

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the blank line

ly015 and others added 10 commits June 24, 2021 22:08
open-mmlab#1076)

* EvalHook uses case-insensitive key indicator matching and configurable test functions

* * fix docstring

* * move test_fn import into __init__
* configurable greater/less keys

* * update unittest
* update DistEvalHook

* fix comments and remove debug code

* support single greater/less key
* Fix the permission denied error on windows.

* Format code.

* Using a cleaner way.

* Update config.py

use os.unlink instead of unlink

* change  unlink to remove

* add notes for new implementation

* Fix typo

Co-authored-by: WRH <[email protected]>
Co-authored-by: Wenwei Zhang <[email protected]>
* Support variables in base files for configs

Signed-off-by: lizz <[email protected]>

* Test json and yaml as well

Signed-off-by: lizz <[email protected]>

* Add test for recusive base

Signed-off-by: lizz <[email protected]>

* Test misleading values

Signed-off-by: lizz <[email protected]>

* Improve comments

Signed-off-by: lizz <[email protected]>

* Add doc

Signed-off-by: lizz <[email protected]>

* Improve doc

Signed-off-by: lizz <[email protected]>

* More tests

Signed-off-by: lizz <[email protected]>

* Harder test case

Signed-off-by: lizz <[email protected]>

* use BASE_KEY instead of base

Signed-off-by: lizz <[email protected]>
* 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.
…tention (open-mmlab#1143)

* optimize criss cross attention

* optimize criss cross attention

* optimize criss cross attention

* fix lint

* fix ci, remove useless variable

* better ca_forward_kernel

Co-authored-by: wondervictor <[email protected]>
…b#1091)

* Support image reading while ignoring EXIF orientation info

Add unit test for ignore_orientation flags in imread()

* add documentation for imread

* Add test cases
* 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.
* [Fix] Fix SyncBN build in PyTorch 1.9

* fixed parrots SyncBN
@ZwwWayne ZwwWayne mentioned this pull request Jun 27, 2021
20 tasks
zhouzaida and others added 14 commits June 28, 2021 17:31
* 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 <[email protected]>
* Change dict update order

* Change dict() with {}

* Added comments with PR link

* Fixed comments according to Lint Job
* fix saconv

* update

* update

* fix

* use LooseVersion
* [Docs] Refactor documentation

* [Docs] Refactor documentation

* refactor docs

* refactor docs

* set sphinx==3.1.2

* fix typo

* modify according to comment

* modify according to comment

* modify according to comment

* [Docs] delete unnecessary file

* fix title

* rename

* rename
* fix test.txt

* fix unittest in pt1.9

* fix checkpoint filename error

* add comment

* fix unittest

* fix onnxruntime version
* add ci for pt1.8 pt1.9

* remove cp command

* change cuda verison

* fix typo

* fix ci

* fix typo
* [Docs] Fix sphinx version

* [Docs] Remove sphinx_markdown_tables

* update readme link

* add sphinx_rtd_theme package
* Remove _build directroy in docs_zh_CN

* Change utils title to Chinese

* Translate documents

* Translate documents

* Use symbolic link to avoid repeated images

* Use symbolic link to avoid repeated images

* fix readme.md

* update copyright

* refactor docs

* rename title to Chinese
@gengenkai gengenkai closed this Jul 8, 2021
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.