Commit ba98bc47 authored by Mostafa Rahmani's avatar Mostafa Rahmani Committed by GitHub
Browse files

Update ptb_word_lm.py

bug fix for contrib.deprecated eliminatation in tf version 12.
parent edd4ba11
......@@ -331,14 +331,14 @@ def main(_):
train_input = PTBInput(config=config, data=train_data, name="TrainInput")
with tf.variable_scope("Model", reuse=None, initializer=initializer):
m = PTBModel(is_training=True, config=config, input_=train_input)
tf.contrib.deprecated.scalar_summary("Training Loss", m.cost)
tf.contrib.deprecated.scalar_summary("Learning Rate", m.lr)
tf.scalar_summary("Training Loss", m.cost)
tf.scalar_summary("Learning Rate", m.lr)
with tf.name_scope("Valid"):
valid_input = PTBInput(config=config, data=valid_data, name="ValidInput")
with tf.variable_scope("Model", reuse=True, initializer=initializer):
mvalid = PTBModel(is_training=False, config=config, input_=valid_input)
tf.contrib.deprecated.scalar_summary("Validation Loss", mvalid.cost)
tf.scalar_summary("Validation Loss", mvalid.cost)
with tf.name_scope("Test"):
test_input = PTBInput(config=eval_config, data=test_data, name="TestInput")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment