Added reference summary before loop

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2019-05-08 14:03:52 +02:00
parent f0869f0807
commit d7c81791e2

View File

@ -186,7 +186,7 @@ def _predict_one_epoch(dataset: tf.data.Dataset,
from tensorflow.python.eager import context from tensorflow.python.eager import context
trs = tracker.SummaryTracker() trs = tracker.SummaryTracker()
trs.print_diff() orig_summary = trs.create_summary()
for inputs in dataset: for inputs in dataset:
decoded_predictions_batch = [] decoded_predictions_batch = []
@ -196,9 +196,9 @@ def _predict_one_epoch(dataset: tf.data.Dataset,
decoded_predictions_batch.append(result) decoded_predictions_batch.append(result)
del result del result
else: else:
trs.print_diff() trs.print_diff(orig_summary)
result = np.array(ssd(inputs)) result = np.array(ssd(inputs))
trs.print_diff() trs.print_diff(orig_summary)
decoded_predictions_batch.append(result) decoded_predictions_batch.append(result)
del result del result
@ -221,7 +221,7 @@ def _predict_one_epoch(dataset: tf.data.Dataset,
context.context()._clear_caches() context.context()._clear_caches()
gc.collect() gc.collect()
trs.print_diff() trs.print_diff(orig_summary)
epoch_end_time = time.time() epoch_end_time = time.time()
per_epoch_time = epoch_end_time - epoch_start_time per_epoch_time = epoch_end_time - epoch_start_time