|
| 1 | +# Faster R-CNN with Inception Resnet v2, Atrous version; |
| 2 | +# Configured for Open Images Dataset. |
| 3 | +# Users should configure the fine_tune_checkpoint field in the train config as |
| 4 | +# well as the label_map_path and input_path fields in the train_input_reader and |
| 5 | +# eval_input_reader. Search for "PATH_TO_BE_CONFIGURED" to find the fields that |
| 6 | +# should be configured. |
| 7 | + |
| 8 | +model { |
| 9 | + faster_rcnn { |
| 10 | + num_classes: 546 |
| 11 | + image_resizer { |
| 12 | + keep_aspect_ratio_resizer { |
| 13 | + min_dimension: 600 |
| 14 | + max_dimension: 1024 |
| 15 | + } |
| 16 | + } |
| 17 | + feature_extractor { |
| 18 | + type: 'faster_rcnn_inception_resnet_v2' |
| 19 | + first_stage_features_stride: 8 |
| 20 | + } |
| 21 | + first_stage_anchor_generator { |
| 22 | + grid_anchor_generator { |
| 23 | + scales: [0.25, 0.5, 1.0, 2.0] |
| 24 | + aspect_ratios: [0.5, 1.0, 2.0] |
| 25 | + height_stride: 8 |
| 26 | + width_stride: 8 |
| 27 | + } |
| 28 | + } |
| 29 | + first_stage_atrous_rate: 2 |
| 30 | + first_stage_box_predictor_conv_hyperparams { |
| 31 | + op: CONV |
| 32 | + regularizer { |
| 33 | + l2_regularizer { |
| 34 | + weight: 0.0 |
| 35 | + } |
| 36 | + } |
| 37 | + initializer { |
| 38 | + truncated_normal_initializer { |
| 39 | + stddev: 0.01 |
| 40 | + } |
| 41 | + } |
| 42 | + } |
| 43 | + first_stage_nms_score_threshold: 0.0 |
| 44 | + first_stage_nms_iou_threshold: 0.7 |
| 45 | + first_stage_max_proposals: 300 |
| 46 | + first_stage_localization_loss_weight: 2.0 |
| 47 | + first_stage_objectness_loss_weight: 1.0 |
| 48 | + initial_crop_size: 17 |
| 49 | + maxpool_kernel_size: 1 |
| 50 | + maxpool_stride: 1 |
| 51 | + second_stage_box_predictor { |
| 52 | + mask_rcnn_box_predictor { |
| 53 | + use_dropout: false |
| 54 | + dropout_keep_probability: 1.0 |
| 55 | + fc_hyperparams { |
| 56 | + op: FC |
| 57 | + regularizer { |
| 58 | + l2_regularizer { |
| 59 | + weight: 0.0 |
| 60 | + } |
| 61 | + } |
| 62 | + initializer { |
| 63 | + variance_scaling_initializer { |
| 64 | + factor: 1.0 |
| 65 | + uniform: true |
| 66 | + mode: FAN_AVG |
| 67 | + } |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | + } |
| 72 | + second_stage_post_processing { |
| 73 | + batch_non_max_suppression { |
| 74 | + score_threshold: 0.0 |
| 75 | + iou_threshold: 0.6 |
| 76 | + max_detections_per_class: 100 |
| 77 | + max_total_detections: 100 |
| 78 | + } |
| 79 | + score_converter: SOFTMAX |
| 80 | + } |
| 81 | + second_stage_localization_loss_weight: 2.0 |
| 82 | + second_stage_classification_loss_weight: 1.0 |
| 83 | + } |
| 84 | +} |
| 85 | + |
| 86 | +train_config: { |
| 87 | + batch_size: 1 |
| 88 | + optimizer { |
| 89 | + momentum_optimizer: { |
| 90 | + learning_rate: { |
| 91 | + manual_step_learning_rate { |
| 92 | + initial_learning_rate: 0.00006 |
| 93 | + schedule { |
| 94 | + step: 0 |
| 95 | + learning_rate: .00006 |
| 96 | + } |
| 97 | + schedule { |
| 98 | + step: 6000000 |
| 99 | + learning_rate: .000006 |
| 100 | + } |
| 101 | + schedule { |
| 102 | + step: 7000000 |
| 103 | + learning_rate: .0000006 |
| 104 | + } |
| 105 | + } |
| 106 | + } |
| 107 | + momentum_optimizer_value: 0.9 |
| 108 | + } |
| 109 | + use_moving_average: false |
| 110 | + } |
| 111 | + gradient_clipping_by_norm: 10.0 |
| 112 | + fine_tune_checkpoint: "PATH_TO_BE_CONFIGURED/model.ckpt" |
| 113 | + # Note: The below line limits the training process to 800K steps, which we |
| 114 | + # empirically found to be sufficient enough to train the Open Images dataset. |
| 115 | + # This effectively bypasses the learning rate schedule (the learning rate will |
| 116 | + # never decay). Remove the below line to train indefinitely. |
| 117 | + num_steps: 8000000 |
| 118 | + data_augmentation_options { |
| 119 | + random_horizontal_flip { |
| 120 | + } |
| 121 | + } |
| 122 | +} |
| 123 | + |
| 124 | +train_input_reader: { |
| 125 | + tf_record_input_reader { |
| 126 | + input_path: "PATH_TO_BE_CONFIGURED/oid_bbox_trainable_train.record" |
| 127 | + } |
| 128 | + label_map_path: "PATH_TO_BE_CONFIGURED/oid_bbox_trainable_label_map.pbtxt" |
| 129 | +} |
| 130 | + |
| 131 | +eval_config: { |
| 132 | + metrics_set: "open_images_metrics" |
| 133 | + num_examples: 8000 |
| 134 | + # Note: The below line limits the evaluation process to 10 evaluations. |
| 135 | + # Remove the below line to evaluate indefinitely. |
| 136 | + max_evals: 10 |
| 137 | +} |
| 138 | + |
| 139 | +eval_input_reader: { |
| 140 | + tf_record_input_reader { |
| 141 | + input_path: "PATH_TO_BE_CONFIGURED/oid_bbox_trainable_val.record" |
| 142 | + } |
| 143 | + label_map_path: "PATH_TO_BE_CONFIGURED/oid_bbox_trainable_label_map.pbtxt" |
| 144 | + shuffle: false |
| 145 | + num_readers: 1 |
| 146 | +} |
0 commit comments