[Bug] Fix a bug in base distiller and add yolox distill example
Motivation
As the title
BC-breaking (Optional)
Does the modification introduce changes that break the backward compatibility of the downstream repositories? 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
Before PR:
- [ ] Pre-commit or other linting tools are used to fix the potential lint issues.
- [ ] Bug fixes are fully covered by unit tests, the case that causes the bug should be added in the unit tests.
- [ ] The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
- [ ] The documentation has been modified accordingly, like docstring or example tutorials.
After PR:
- [ ] If the modification has potential influence on downstream or other related projects, this PR should be tested with those projects, like MMDet or MMSeg.
- [ ] CLA has been signed and all committers have signed the CLA in this PR.
Codecov Report
Merging #192 (8d962ff) into master (3cc359e) will increase coverage by
1.93%. The diff coverage isn/a.
@@ Coverage Diff @@
## master #192 +/- ##
==========================================
+ Coverage 63.95% 65.88% +1.93%
==========================================
Files 93 93
Lines 3462 3462
Branches 640 640
==========================================
+ Hits 2214 2281 +67
+ Misses 1136 1077 -59
+ Partials 112 104 -8
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 65.85% <ø> (+1.90%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
| Impacted Files | Coverage Δ | |
|---|---|---|
| mmrazor/models/distillers/base.py | 42.25% <ø> (ø) |
|
| mmrazor/models/pruners/structure_pruning.py | 91.93% <0.00%> (+2.30%) |
:arrow_up: |
| mmrazor/utils/misc.py | 100.00% <0.00%> (+4.76%) |
:arrow_up: |
| mmrazor/models/algorithms/autoslim.py | 71.31% <0.00%> (+14.72%) |
:arrow_up: |
| mmrazor/utils/setup_env.py | 100.00% <0.00%> (+27.27%) |
:arrow_up: |
| mmrazor/models/pruners/ratio_pruning.py | 90.41% <0.00%> (+30.13%) |
:arrow_up: |
| mmrazor/models/pruners/utils/switchable_bn.py | 100.00% <0.00%> (+69.23%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update 3cc359e...8d962ff. Read the comment docs.