Skip to content

Commit

Permalink
fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Lxtccc committed Jan 10, 2023
1 parent cf81f88 commit c9715c0
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions configs/pruning/mmcls/dcff/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Recent works imply that the channel pruning can be regarded as searching optimal

### 1.Classification

|Dataset| Supernet | Flops(M) | Top-1 (%) | Top-5 (%) | Config | Download |
|:---------------------:|:---------------------:|:------:|:---------:|:--------:|:---------:|:------:|
|ImageNet| ResNet50 | - | - | - | [config](./dmcp_resnet50_supernet_8xb32.py) | \[model\] / [arch](./DMCP_SUBNET_IMAGENET.yaml)/ \[log\] |
| Dataset | Supernet | Flops(M) | Top-1 (%) | Top-5 (%) | Config | Download |
| :------: | :------: | :------: | :-------: | :-------: | :-----------------------------------------: | :------------------------------------------------------: |
| ImageNet | ResNet50 | - | - | - | [config](./dmcp_resnet50_supernet_8xb32.py) | \[model\] / [arch](./DMCP_SUBNET_IMAGENET.yaml)/ \[log\] |

## Getting Started

Expand Down
6 changes: 3 additions & 3 deletions configs/pruning/mmcls/dmcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Recent works imply that the channel pruning can be regarded as searching optimal

### 1.Classification

|Dataset| Supernet | Flops(M) | Top-1 (%) | Top-5 (%) | Config | Download |
|:---------------------:|:---------------------:|:------:|:---------:|:--------:|:---------:|:------:|
|ImageNet| ResNet50 | - | - | - | [config](./dmcp_resnet50_supernet_8xb32.py) | \[model\] / [arch](./DMCP_SUBNET_IMAGENET.yaml)/ \[log\] |
| Dataset | Supernet | Flops(M) | Top-1 (%) | Top-5 (%) | Config | Download |
| :------: | :------: | :------: | :-------: | :-------: | :-----------------------------------------: | :------------------------------------------------------: |
| ImageNet | ResNet50 | - | - | - | [config](./dmcp_resnet50_supernet_8xb32.py) | \[model\] / [arch](./DMCP_SUBNET_IMAGENET.yaml)/ \[log\] |

## Getting Started

Expand Down
1 change: 0 additions & 1 deletion configs/pruning/mmcls/dmcp/dmcp_resnet50_subnet_8xb32.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
_base_ = ['dmcp_resnet_8xb32.py']


_base_.optim_wrapper = dict(
optimizer=dict(type='SGD', lr=0.25, momentum=0.9, weight_decay=0.0001))

Expand Down
5 changes: 1 addition & 4 deletions configs/pruning/mmcls/dmcp/dmcp_resnet50_supernet_8xb32.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
param_scheduler = dict(
type='MultiStepLR', by_epoch=True, milestones=[30, 60, 90], gamma=0.1)

train_cfg = dict(
by_epoch=True,
max_epochs=120,
val_interval=1)
train_cfg = dict(by_epoch=True, max_epochs=120, val_interval=1)

data_preprocessor = {'type': 'mmcls.ClsDataPreprocessor'}

Expand Down
6 changes: 4 additions & 2 deletions mmrazor/engine/hooks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@
from .estimate_resources_hook import EstimateResourcesHook
from .visualization_hook import RazorVisualizationHook

__all__ = ['DumpSubnetHook', 'EstimateResourcesHook', 'RazorVisualizationHook',
'DMCPSubnetHook']
__all__ = [
'DumpSubnetHook', 'EstimateResourcesHook', 'RazorVisualizationHook',
'DMCPSubnetHook'
]
2 changes: 1 addition & 1 deletion mmrazor/models/algorithms/pruning/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

__all__ = [
'SlimmableNetwork', 'SlimmableNetworkDDP', 'DCFF', 'DMCP', 'DMCPDDP'
]
]
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Conv3dCounter(ConvCounter):

@TASK_UTILS.register_module()
class DynamicConv2dCounter(ConvCounter):

@staticmethod
def add_count_hook(module: nn.Conv2d, input, output):
input = input[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@ def add_count_hook(module, input, output):
batch_flops *= 2
num_features = module.mutable_attrs['num_features'].activated_channels
module.__flops__ += batch_flops
module.__params__ += num_features*2
module.__params__ += num_features * 2
1 change: 1 addition & 0 deletions tests/test_models/test_mutators/test_dmcp_mutator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


class ResBlock(Module):

def __init__(self) -> None:
super().__init__()

Expand Down

0 comments on commit c9715c0

Please sign in to comment.