File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ def define_flags():
101101 flags .DEFINE_string ('model_name' , 'efficientdet-d0' , 'Model name.' )
102102 flags .DEFINE_bool ('debug' , False , 'Enable debug mode' )
103103 flags .DEFINE_integer (
104- 'tf_random_seed' , 111111 ,
104+ 'tf_random_seed' , None ,
105105 'Fixed random seed for deterministic execution across runs for debugging.'
106106 )
107107 flags .DEFINE_bool ('profile' , False , 'Enable profile mode' )
@@ -163,10 +163,12 @@ def main(_):
163163 for gpu in tf .config .list_physical_devices ('GPU' ):
164164 tf .config .experimental .set_memory_growth (gpu , True )
165165
166+ if FLAGS .tf_random_seed :
167+ tf .random .set_seed (FLAGS .tf_random_seed )
168+
166169 if FLAGS .debug :
167170 tf .debugging .set_log_device_placement (True )
168171 os .environ ['TF_DETERMINISTIC_OPS' ] = '1'
169- tf .random .set_seed (FLAGS .tf_random_seed )
170172 logging .set_verbosity (logging .DEBUG )
171173
172174 if FLAGS .strategy == 'tpu' :
You can’t perform that action at this time.
0 commit comments