You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

136 lines
3.5 KiB

6 years ago
  1. # R-FCN with Resnet-101 (v1), configured for Oxford-IIIT Pets Dataset.
  2. # Users should configure the fine_tune_checkpoint field in the train config as
  3. # well as the label_map_path and input_path fields in the train_input_reader and
  4. # eval_input_reader. Search for "PATH_TO_BE_CONFIGURED" to find the fields that
  5. # should be configured.
  6. model {
  7. faster_rcnn {
  8. num_classes: 37
  9. image_resizer {
  10. keep_aspect_ratio_resizer {
  11. min_dimension: 600
  12. max_dimension: 1024
  13. }
  14. }
  15. feature_extractor {
  16. type: 'faster_rcnn_resnet101'
  17. first_stage_features_stride: 16
  18. }
  19. first_stage_anchor_generator {
  20. grid_anchor_generator {
  21. scales: [0.25, 0.5, 1.0, 2.0]
  22. aspect_ratios: [0.5, 1.0, 2.0]
  23. height_stride: 16
  24. width_stride: 16
  25. }
  26. }
  27. first_stage_box_predictor_conv_hyperparams {
  28. op: CONV
  29. regularizer {
  30. l2_regularizer {
  31. weight: 0.0
  32. }
  33. }
  34. initializer {
  35. truncated_normal_initializer {
  36. stddev: 0.01
  37. }
  38. }
  39. }
  40. first_stage_nms_score_threshold: 0.0
  41. first_stage_nms_iou_threshold: 0.7
  42. first_stage_max_proposals: 300
  43. first_stage_localization_loss_weight: 2.0
  44. first_stage_objectness_loss_weight: 1.0
  45. second_stage_box_predictor {
  46. rfcn_box_predictor {
  47. conv_hyperparams {
  48. op: CONV
  49. regularizer {
  50. l2_regularizer {
  51. weight: 0.0
  52. }
  53. }
  54. initializer {
  55. truncated_normal_initializer {
  56. stddev: 0.01
  57. }
  58. }
  59. }
  60. crop_height: 18
  61. crop_width: 18
  62. num_spatial_bins_height: 3
  63. num_spatial_bins_width: 3
  64. }
  65. }
  66. second_stage_post_processing {
  67. batch_non_max_suppression {
  68. score_threshold: 0.0
  69. iou_threshold: 0.6
  70. max_detections_per_class: 100
  71. max_total_detections: 300
  72. }
  73. score_converter: SOFTMAX
  74. }
  75. second_stage_localization_loss_weight: 2.0
  76. second_stage_classification_loss_weight: 1.0
  77. }
  78. }
  79. train_config: {
  80. batch_size: 1
  81. optimizer {
  82. momentum_optimizer: {
  83. learning_rate: {
  84. manual_step_learning_rate {
  85. initial_learning_rate: 0.0003
  86. schedule {
  87. step: 900000
  88. learning_rate: .00003
  89. }
  90. schedule {
  91. step: 1200000
  92. learning_rate: .000003
  93. }
  94. }
  95. }
  96. momentum_optimizer_value: 0.9
  97. }
  98. use_moving_average: false
  99. }
  100. gradient_clipping_by_norm: 10.0
  101. fine_tune_checkpoint: "PATH_TO_BE_CONFIGURED/model.ckpt"
  102. from_detection_checkpoint: true
  103. load_all_detection_checkpoint_vars: true
  104. # Note: The below line limits the training process to 200K steps, which we
  105. # empirically found to be sufficient enough to train the pets dataset. This
  106. # effectively bypasses the learning rate schedule (the learning rate will
  107. # never decay). Remove the below line to train indefinitely.
  108. num_steps: 200000
  109. data_augmentation_options {
  110. random_horizontal_flip {
  111. }
  112. }
  113. }
  114. train_input_reader: {
  115. tf_record_input_reader {
  116. input_path: "PATH_TO_BE_CONFIGURED/pet_faces_train.record-?????-of-00010"
  117. }
  118. label_map_path: "PATH_TO_BE_CONFIGURED/pet_label_map.pbtxt"
  119. }
  120. eval_config: {
  121. metrics_set: "coco_detection_metrics"
  122. num_examples: 1101
  123. }
  124. eval_input_reader: {
  125. tf_record_input_reader {
  126. input_path: "PATH_TO_BE_CONFIGURED/pet_faces_val.record-?????-of-00010"
  127. }
  128. label_map_path: "PATH_TO_BE_CONFIGURED/pet_label_map.pbtxt"
  129. shuffle: false
  130. num_readers: 1
  131. }