Skip to content

Commit

Permalink
TF test_grad_summaries small fix
Browse files Browse the repository at this point in the history
Needed now because LR meta info reads LR
  • Loading branch information
albertz committed Nov 10, 2023
1 parent c0eae55 commit b5dcd4d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tests/test_TFEngine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5050,6 +5050,7 @@ def test_grad_summaries():
print("extern data:", engine.config.typed_value("extern_data"))

engine.init_train_from_config()
engine.init_train_epoch()

def extra_fetches_cb(summary_proto):
"""
Expand All @@ -5071,7 +5072,9 @@ def extra_fetches_cb(summary_proto):
max_seqs=100,
used_data_keys=engine.network.used_data_keys,
)
forwarder = Runner(

engine.updater.set_learning_rate(engine.learning_rate, session=engine.tf_session)
trainer = Runner(
engine=engine,
dataset=train_data,
batches=batches,
Expand All @@ -5082,8 +5085,8 @@ def extra_fetches_cb(summary_proto):
},
extra_fetches_callback=extra_fetches_cb,
)
forwarder.run(report_prefix="test_grad_summaries")
if not forwarder.finalized:
trainer.run(report_prefix="test_grad_summaries")
if not trainer.finalized:
raise Exception("Error happened. Exit now.")


Expand Down

0 comments on commit b5dcd4d

Please sign in to comment.