ssdlite_ghostnet.yml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. architecture: SSD
  2. use_gpu: true
  3. max_iters: 400000
  4. snapshot_iter: 20000
  5. log_iter: 20
  6. metric: COCO
  7. pretrain_weights: https://paddle-imagenet-models-name.bj.bcebos.com/GhostNet_x1_3_ssld_pretrained.tar
  8. save_dir: output
  9. weights: output/ssdlite_ghostnet/model_final
  10. # 80(label_class) + 1(background)
  11. num_classes: 81
  12. SSD:
  13. backbone: GhostNet
  14. multi_box_head: SSDLiteMultiBoxHead
  15. output_decoder:
  16. background_label: 0
  17. keep_top_k: 200
  18. nms_eta: 1.0
  19. nms_threshold: 0.45
  20. nms_top_k: 400
  21. score_threshold: 0.01
  22. GhostNet:
  23. scale: 1.3
  24. extra_block_filters: [[256, 512], [128, 256], [128, 256], [64, 128]]
  25. feature_maps: [5, 7, 8, 9, 10, 11]
  26. conv_decay: 0.00004
  27. lr_mult_list: [0.25, 0.25, 0.5, 0.5, 0.75]
  28. SSDLiteMultiBoxHead:
  29. aspect_ratios: [[2.], [2., 3.], [2., 3.], [2., 3.], [2., 3.], [2., 3.]]
  30. base_size: 320
  31. steps: [16, 32, 64, 107, 160, 320]
  32. flip: true
  33. clip: true
  34. max_ratio: 95
  35. min_ratio: 20
  36. offset: 0.5
  37. conv_decay: 0.00004
  38. LearningRate:
  39. base_lr: 0.2
  40. schedulers:
  41. - !CosineDecay
  42. max_iters: 400000
  43. - !LinearWarmup
  44. start_factor: 0.33333
  45. steps: 2000
  46. OptimizerBuilder:
  47. optimizer:
  48. momentum: 0.9
  49. type: Momentum
  50. regularizer:
  51. factor: 0.0005
  52. type: L2
  53. TrainReader:
  54. inputs_def:
  55. image_shape: [3, 320, 320]
  56. fields: ['image', 'gt_bbox', 'gt_class']
  57. dataset:
  58. !COCODataSet
  59. dataset_dir: dataset/coco
  60. anno_path: annotations/instances_train2017.json
  61. image_dir: train2017
  62. sample_transforms:
  63. - !DecodeImage
  64. to_rgb: true
  65. - !RandomDistort
  66. brightness_lower: 0.875
  67. brightness_upper: 1.125
  68. is_order: true
  69. - !RandomExpand
  70. fill_value: [123.675, 116.28, 103.53]
  71. - !RandomCrop
  72. allow_no_crop: false
  73. - !NormalizeBox {}
  74. - !ResizeImage
  75. interp: 1
  76. target_size: 320
  77. use_cv2: false
  78. - !RandomFlipImage
  79. is_normalized: false
  80. - !NormalizeImage
  81. mean: [0.485, 0.456, 0.406]
  82. std: [0.229, 0.224, 0.225]
  83. is_scale: true
  84. is_channel_first: false
  85. - !Permute
  86. to_bgr: false
  87. channel_first: true
  88. batch_size: 64
  89. shuffle: true
  90. drop_last: true
  91. # Number of working threads/processes. To speed up, can be set to 16 or 32 etc.
  92. worker_num: 8
  93. # Size of shared memory used in result queue. After increasing `worker_num`, need expand `memsize`.
  94. memsize: 8G
  95. # Buffer size for multi threads/processes.one instance in buffer is one batch data.
  96. # To speed up, can be set to 64 or 128 etc.
  97. bufsize: 32
  98. use_process: true
  99. EvalReader:
  100. inputs_def:
  101. image_shape: [3, 320, 320]
  102. fields: ['image', 'gt_bbox', 'gt_class', 'im_shape', 'im_id']
  103. dataset:
  104. !COCODataSet
  105. dataset_dir: dataset/coco
  106. anno_path: annotations/instances_val2017.json
  107. image_dir: val2017
  108. sample_transforms:
  109. - !DecodeImage
  110. to_rgb: true
  111. - !NormalizeBox {}
  112. - !ResizeImage
  113. interp: 1
  114. target_size: 320
  115. use_cv2: false
  116. - !NormalizeImage
  117. mean: [0.485, 0.456, 0.406]
  118. std: [0.229, 0.224, 0.225]
  119. is_scale: true
  120. is_channel_first: false
  121. - !Permute
  122. to_bgr: false
  123. channel_first: True
  124. batch_size: 8
  125. worker_num: 8
  126. bufsize: 32
  127. use_process: false
  128. TestReader:
  129. inputs_def:
  130. image_shape: [3,320,320]
  131. fields: ['image', 'im_id', 'im_shape']
  132. dataset:
  133. !ImageFolder
  134. anno_path: annotations/instances_val2017.json
  135. sample_transforms:
  136. - !DecodeImage
  137. to_rgb: true
  138. - !ResizeImage
  139. interp: 1
  140. max_size: 0
  141. target_size: 320
  142. use_cv2: true
  143. - !NormalizeImage
  144. mean: [0.485, 0.456, 0.406]
  145. std: [0.229, 0.224, 0.225]
  146. is_scale: true
  147. is_channel_first: false
  148. - !Permute
  149. to_bgr: false
  150. channel_first: True
  151. batch_size: 1