@@ -87,7 +87,7 @@ def main(_):
8787
8888 run_config = tf .estimator .RunConfig (
8989 save_summary_steps = None ,
90- save_checkpoints_steps = dataset .train_steps * FLAGS .train_epochs ,
90+ save_checkpoints_steps = None if FLAGS . benchmark else dataset .train_steps * FLAGS .train_epoch ,
9191 save_checkpoints_secs = None ,
9292 tf_random_seed = None ,
9393 session_config = config ,
@@ -112,22 +112,32 @@ def main(_):
112112 if hvd .rank () == 0 :
113113 train_hooks += [TrainHook (FLAGS .log_every , DLLogger )]
114114
115+ DLLogger .log (step = tuple (), data = {"training" : "START" })
116+
115117 estimator .train (
116118 input_fn = lambda : dataset .train_fn (FLAGS .augment ),
117119 steps = steps ,
118120 hooks = train_hooks )
119121
122+ DLLogger .log (step = tuple (), data = {"training" : "FINISHED" })
123+
120124 if 'evaluate' in FLAGS .exec_mode :
121125 if hvd .rank () == 0 :
122126 if FLAGS .train_split >= 1.0 :
123127 raise ValueError ("Missing argument: --train_split < 1.0" )
128+
129+ DLLogger .log (step = tuple (), data = {"evaluating" : "START" })
130+
124131 result = estimator .evaluate (
125132 input_fn = dataset .eval_fn ,
126133 steps = dataset .eval_steps ,
127134 hooks = [])
128- DLLogger .log (step = tuple (), data = {'background_dice' : result ['background dice' ]})
129- DLLogger .log (step = tuple (), data = {'anterior_dice' : result ['Anterior dice' ]})
130- DLLogger .log (step = tuple (), data = {'posterior_dice' : result ['Posterior dice' ]})
135+
136+ DLLogger .log (step = tuple (), data = {"evaluating" : "FINISH" })
137+
138+ DLLogger .log (step = tuple (), data = {'background_dice' : str (result ['background dice' ])})
139+ DLLogger .log (step = tuple (), data = {'anterior_dice' : str (result ['Anterior dice' ])})
140+ DLLogger .log (step = tuple (), data = {'posterior_dice' : str (result ['Posterior dice' ])})
131141
132142 if 'predict' in FLAGS .exec_mode :
133143 count = 1
0 commit comments