Skip to content

Commit

Permalink
fix bug when lang_stats not set to 1
Browse files Browse the repository at this point in the history
  • Loading branch information
clu8 authored and ruotianluo committed Nov 26, 2017
1 parent fd445dc commit 275e22c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions train.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,9 @@ def train(opt):
# Write validation result into summary
if tf is not None:
add_summary_value(tf_summary_writer, 'validation loss', val_loss, iteration)
for k,v in lang_stats.items():
add_summary_value(tf_summary_writer, k, v, iteration)
if lang_stats is not None:
for k,v in lang_stats.items():
add_summary_value(tf_summary_writer, k, v, iteration)
tf_summary_writer.flush()
val_result_history[iteration] = {'loss': val_loss, 'lang_stats': lang_stats, 'predictions': predictions}

Expand Down

0 comments on commit 275e22c

Please sign in to comment.