ofa_picodet_demo.yml 4.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. weights: https://paddledet.bj.bcebos.com/models/pretrained/ESNet_x1_0_pretrained.pdparams
  2. slim: OFA
  3. OFA:
  4. ofa_config:
  5. task: expand_ratio
  6. expand_ratio: [0.5, 1]
  7. skip_neck: True
  8. skip_head: True
  9. RunConfig:
  10. # Skip the output layer of each block by layer name
  11. skip_layers: ['backbone._conv1._conv','backbone.2_1._conv_linear_1._conv',
  12. 'backbone.2_1._conv_linear_2._conv', 'backbone.2_1._conv_dw_mv1._conv',
  13. 'backbone.2_1._conv_pw_mv1._conv', 'backbone.2_2._conv_linear._conv',
  14. 'backbone.2_3._conv_linear._conv', 'backbone.3_1._conv_linear_1._conv',
  15. 'backbone.3_1._conv_linear_2._conv', 'backbone.3_1._conv_dw_mv1._conv',
  16. 'backbone.3_1._conv_pw_mv1._conv', 'backbone.3_2._conv_linear._conv',
  17. 'backbone.3_3._conv_linear._conv', 'backbone.3_4._conv_linear._conv',
  18. 'backbone.3_5._conv_linear._conv', 'backbone.3_6._conv_linear._conv',
  19. 'backbone.3_7._conv_linear._conv', 'backbone.4_1._conv_linear_1._conv',
  20. 'backbone.4_1._conv_linear_2._conv', 'backbone.4_1._conv_dw_mv1._conv',
  21. 'backbone.4_1._conv_pw_mv1._conv', 'backbone.4_2._conv_linear._conv',
  22. 'backbone.4_3._conv_linear._conv']
  23. # For block-wise search, make layers in each block in the same search sapce
  24. same_search_space: [
  25. ['backbone.2_1._conv_dw_1._conv', 'backbone.2_1._conv_pw_2._conv',
  26. 'backbone.2_1._conv_dw_2._conv', 'backbone.2_1._se.conv1', 'backbone.2_1._se.conv2'],
  27. ['backbone.2_2._conv_pw._conv', 'backbone.2_2._conv_dw._conv',
  28. 'backbone.2_2._se.conv1', 'backbone.2_2._se.conv2'],
  29. ['backbone.2_3._conv_pw._conv', 'backbone.2_3._conv_dw._conv',
  30. 'backbone.2_3._se.conv1', 'backbone.2_3._se.conv2'],
  31. ['backbone.3_1._conv_dw_1._conv', 'backbone.3_1._conv_pw_2._conv',
  32. 'backbone.3_1._conv_dw_2._conv', 'backbone.3_1._se.conv1', 'backbone.3_1._se.conv2'],
  33. ['backbone.3_2._conv_pw._conv', 'backbone.3_2._conv_dw._conv',
  34. 'backbone.3_2._se.conv1', 'backbone.3_2._se.conv2'],
  35. ['backbone.3_3._conv_pw._conv', 'backbone.3_3._conv_dw._conv',
  36. 'backbone.3_3._se.conv1', 'backbone.3_3._se.conv2'],
  37. ['backbone.3_4._conv_pw._conv', 'backbone.3_4._conv_dw._conv',
  38. 'backbone.3_4._se.conv1', 'backbone.3_4._se.conv2'],
  39. ['backbone.3_5._conv_pw._conv', 'backbone.3_5._conv_dw._conv',
  40. 'backbone.3_5._se.conv1', 'backbone.3_5._se.conv2'],
  41. ['backbone.3_6._conv_pw._conv', 'backbone.3_6._conv_dw._conv',
  42. 'backbone.3_6._se.conv1', 'backbone.3_6._se.conv2'],
  43. ['backbone.3_7._conv_pw._conv', 'backbone.3_7._conv_dw._conv',
  44. 'backbone.3_7._se.conv1', 'backbone.3_7._se.conv2'],
  45. ['backbone.4_1._conv_dw_1._conv', 'backbone.4_1._conv_pw_2._conv',
  46. 'backbone.4_1._conv_dw_2._conv', 'backbone.4_1._se.conv1', 'backbone.4_1._se.conv2'],
  47. ['backbone.4_2._conv_pw._conv', 'backbone.4_2._conv_dw._conv',
  48. 'backbone.4_2._se.conv1', 'backbone.4_2._se.conv2'],
  49. ['backbone.4_3._conv_pw._conv', 'backbone.4_3._conv_dw._conv',
  50. 'backbone.4_3._se.conv1', 'backbone.4_3._se.conv2']]
  51. # demo expand ratio
  52. # Generally, for expand ratio, float in (0, 1] is available.
  53. # But please be careful if the model is complicated.
  54. # For picodet, there are many split and concat, the choice of channel number is important.
  55. ofa_layers:
  56. 'backbone.2_1._conv_dw_1._conv':
  57. 'expand_ratio': [0.5, 1]
  58. 'backbone.2_2._conv_pw._conv':
  59. 'expand_ratio': [0.5, 1]
  60. 'backbone.2_3._conv_pw._conv':
  61. 'expand_ratio': [0.5, 1]
  62. 'backbone.3_1._conv_dw_1._conv':
  63. 'expand_ratio': [0.5, 1]
  64. 'backbone.3_2._conv_pw._conv':
  65. 'expand_ratio': [0.5, 1]
  66. 'backbone.3_3._conv_pw._conv':
  67. 'expand_ratio': [0.5, 1]
  68. 'backbone.3_4._conv_pw._conv':
  69. 'expand_ratio': [0.5, 1]
  70. 'backbone.3_5._conv_pw._conv':
  71. 'expand_ratio': [0.5, 1]
  72. 'backbone.3_6._conv_pw._conv':
  73. 'expand_ratio': [0.5, 1]
  74. 'backbone.3_7._conv_pw._conv':
  75. 'expand_ratio': [0.5, 1]
  76. 'backbone.4_1._conv_dw_1._conv':
  77. 'expand_ratio': [0.5, 1]
  78. 'backbone.4_2._conv_pw._conv':
  79. 'expand_ratio': [0.5, 1]
  80. 'backbone.4_3._conv_pw._conv':
  81. 'expand_ratio': [0.5, 1]