detr-gpu-pets.config 2.87 KB
Newer Older
Kaushik Shivakumar's avatar
Kaushik Shivakumar committed
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
26
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# Faster R-CNN with Resnet-50 (v1) with 640x640 input resolution
# Trained on COCO, initialized from Imagenet classification checkpoint

# This config is TPU compatible.

model {
  detr {
    num_classes: 37
    image_resizer {
      keep_aspect_ratio_resizer {
        min_dimension: 450 #640
        max_dimension: 450 #640
        pad_to_max_dimension: true
      }
    }
    feature_extractor {
      type: 'detr_resnet50_keras'
      batch_norm_trainable: true
    }
    post_processing {
      score_converter: SOFTMAX
    }
    giou_localization_loss_weight: 1.0
    l1_localization_loss_weight: 1.0
    classification_loss_weight: 1.0
    use_matmul_gather_in_matcher: true
  }
}

train_config: {
  batch_size: 64
  sync_replicas: true
  startup_delay_steps: 0
  replicas_to_aggregate: 8
  num_steps: 25000
  optimizer {
    adam_optimizer {
      learning_rate {
        manual_step_learning_rate {
          initial_learning_rate: 0.0000
          schedule {
            step: 2000
            learning_rate: 0.0001
          }
          schedule {
            step: 35000
            learning_rate: 0.0001
          }
          schedule {
            step: 40000
            learning_rate: 0.00025
          }
          warmup: true
        }
      }
    }
    use_moving_average: false
  }
  #optimizer {
  #  momentum_optimizer: {
  #    learning_rate: {
  #      manual_step_learning_rate {
  #        initial_learning_rate: 0.0002
  #        schedule {
  #          step: 2000
  #          learning_rate: 0.0002
  #        }
  #        schedule {
  #          step: 35000
  #          learning_rate: 0.003
  #        }
  #        schedule {
  #          step: 40000
  #          learning_rate: 0.00025
  #        }
  #        warmup: true
  #      }
  #    }
  #    momentum_optimizer_value: 0.9
  #  }
  #  use_moving_average: false
  #}
  fine_tune_checkpoint_version: V2
  fine_tune_checkpoint: "gs://object-detection-dogfood/ava-kaushik/pretrained_checkpoint/resnet50/resnet50.ckpt-1" #"gs://object-detection-dogfood/ava-kaushik/tpu-training2/ckpt-26"
  fine_tune_checkpoint_type: "classification"
  data_augmentation_options {
    random_horizontal_flip {
    }
  }

  max_number_of_boxes: 10
  unpad_groundtruth_tensors: false
  use_bfloat16: true  # works only on TPUs
}

train_input_reader: {
  tf_record_input_reader {
    input_path: "gs://object-detection-dogfood/ava-kaushik/pets_records/pet_faces_train*"
  }
  label_map_path: "gs://object-detection-dogfood/ava-kaushik/pet_label_map.pbtxt"
  shuffle: false
}

eval_config: {
  metrics_set: "coco_detection_metrics"
  use_moving_averages: false
  batch_size: 1;
  max_num_boxes_to_visualize: 100
}

eval_input_reader: {
  label_map_path: "gs://object-detection-dogfood/ava-kaushik/pet_label_map.pbtxt"
  shuffle: false
  num_epochs: 1
  tf_record_input_reader {
    input_path: "gs://object-detection-dogfood/ava-kaushik/pets_records/pet_faces_val*"
  }
}