Skip to content

Commit 6f8918d

Browse files
authored
fix #898 (#900)
1 parent c79edec commit 6f8918d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

efficientdet/hparams_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def default_detection_configs():
204204
h.max_level = 7
205205
h.num_scales = 3
206206
# ratio w/h: 2.0 means w=1.4, h=0.7. Can be computed with k-mean per dataset.
207-
h.aspect_ratios = [1.0, 2.0, 0.5]
207+
h.aspect_ratios = [1.0, 2.0, 0.5] #[[0.7, 1.4], [1.0, 1.0], [1.4, 0.7]]
208208
h.anchor_scale = 4.0
209209
# is batchnorm training mode
210210
h.is_training_bn = True
@@ -238,8 +238,8 @@ def default_detection_configs():
238238
h.weight_decay = 4e-5
239239
h.strategy = None # 'tpu', 'gpus', None
240240
h.mixed_precision = False # If False, use float32.
241-
h.loss_scale = 2**10 # If False, use float32.
242-
h.model_optimizations = {} # 'prune'
241+
h.loss_scale = None # set to 2**16 enables dynamic loss scale
242+
h.model_optimizations = {} # 'prune':{}
243243

244244
# For detection.
245245
h.box_class_repeats = 3

efficientdet/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def get_ckpt_var_map(ckpt_path, ckpt_scope, var_scope, skip_mismatch=None):
112112
ckpt_var_names = set(reader.get_variable_to_shape_map().keys())
113113

114114
if tf.distribute.get_replica_context():
115-
replica_id = tf.keras.backend.get_value(
115+
replica_id = tf.get_static_value(
116116
tf.distribute.get_replica_context().replica_id_in_sync_group)
117117
else:
118118
replica_id = 0

0 commit comments

Comments
 (0)