ofa_picodet_demo.yml 4.8 KB
Newer Older
C
Chang Xu 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
weights: https://paddledet.bj.bcebos.com/models/pretrained/ESNet_x1_0_pretrained.pdparams
slim: OFA
OFA:
  ofa_config:
    task: expand_ratio
    expand_ratio: [0.5, 1]

    skip_neck: True
    skip_head: True

    RunConfig:
        # Skip the output layer of each block by layer name
        skip_layers: ['backbone._conv1._conv','backbone.2_1._conv_linear_1._conv',
                       'backbone.2_1._conv_linear_2._conv', 'backbone.2_1._conv_dw_mv1._conv',
                       'backbone.2_1._conv_pw_mv1._conv', 'backbone.2_2._conv_linear._conv',
                       'backbone.2_3._conv_linear._conv', 'backbone.3_1._conv_linear_1._conv',
                       'backbone.3_1._conv_linear_2._conv', 'backbone.3_1._conv_dw_mv1._conv',
                       'backbone.3_1._conv_pw_mv1._conv', 'backbone.3_2._conv_linear._conv',
                       'backbone.3_3._conv_linear._conv', 'backbone.3_4._conv_linear._conv',
                       'backbone.3_5._conv_linear._conv', 'backbone.3_6._conv_linear._conv',
                       'backbone.3_7._conv_linear._conv', 'backbone.4_1._conv_linear_1._conv',
                       'backbone.4_1._conv_linear_2._conv', 'backbone.4_1._conv_dw_mv1._conv',
                       'backbone.4_1._conv_pw_mv1._conv', 'backbone.4_2._conv_linear._conv',
                       'backbone.4_3._conv_linear._conv']

C
chenxujun 已提交
26
        # For block-wise search, make layers in each block in the same search space
C
Chang Xu 已提交
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
        same_search_space: [
                ['backbone.2_1._conv_dw_1._conv', 'backbone.2_1._conv_pw_2._conv',
                 'backbone.2_1._conv_dw_2._conv', 'backbone.2_1._se.conv1', 'backbone.2_1._se.conv2'],
                ['backbone.2_2._conv_pw._conv', 'backbone.2_2._conv_dw._conv',
                 'backbone.2_2._se.conv1', 'backbone.2_2._se.conv2'],
                ['backbone.2_3._conv_pw._conv', 'backbone.2_3._conv_dw._conv',
                 'backbone.2_3._se.conv1', 'backbone.2_3._se.conv2'],
                ['backbone.3_1._conv_dw_1._conv', 'backbone.3_1._conv_pw_2._conv',
                 'backbone.3_1._conv_dw_2._conv', 'backbone.3_1._se.conv1', 'backbone.3_1._se.conv2'],
                ['backbone.3_2._conv_pw._conv', 'backbone.3_2._conv_dw._conv',
                 'backbone.3_2._se.conv1', 'backbone.3_2._se.conv2'],
                ['backbone.3_3._conv_pw._conv', 'backbone.3_3._conv_dw._conv',
                 'backbone.3_3._se.conv1', 'backbone.3_3._se.conv2'],
                ['backbone.3_4._conv_pw._conv', 'backbone.3_4._conv_dw._conv',
                 'backbone.3_4._se.conv1', 'backbone.3_4._se.conv2'],
                ['backbone.3_5._conv_pw._conv', 'backbone.3_5._conv_dw._conv',
                 'backbone.3_5._se.conv1', 'backbone.3_5._se.conv2'],
                ['backbone.3_6._conv_pw._conv', 'backbone.3_6._conv_dw._conv',
                 'backbone.3_6._se.conv1', 'backbone.3_6._se.conv2'],
                ['backbone.3_7._conv_pw._conv', 'backbone.3_7._conv_dw._conv',
                 'backbone.3_7._se.conv1', 'backbone.3_7._se.conv2'],
                ['backbone.4_1._conv_dw_1._conv', 'backbone.4_1._conv_pw_2._conv',
                 'backbone.4_1._conv_dw_2._conv', 'backbone.4_1._se.conv1', 'backbone.4_1._se.conv2'],
                ['backbone.4_2._conv_pw._conv', 'backbone.4_2._conv_dw._conv',
                 'backbone.4_2._se.conv1', 'backbone.4_2._se.conv2'],
                ['backbone.4_3._conv_pw._conv', 'backbone.4_3._conv_dw._conv',
                 'backbone.4_3._se.conv1', 'backbone.4_3._se.conv2']]

        # demo expand ratio
        # Generally, for expand ratio, float in (0, 1] is available.
        # But please be careful if the model is complicated.
        # For picodet, there are many split and concat, the choice of channel number is important.
        ofa_layers:
            'backbone.2_1._conv_dw_1._conv':
                'expand_ratio': [0.5, 1]
            'backbone.2_2._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.2_3._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.3_1._conv_dw_1._conv':
                'expand_ratio': [0.5, 1]
            'backbone.3_2._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.3_3._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.3_4._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.3_5._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.3_6._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.3_7._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.4_1._conv_dw_1._conv':
                'expand_ratio': [0.5, 1]
            'backbone.4_2._conv_pw._conv':
                'expand_ratio': [0.5, 1]
            'backbone.4_3._conv_pw._conv':
                'expand_ratio': [0.5, 1]