Try to test WER while validation

I want to see both loss and WER while validation, so I just add

if FLAGS.test_files:
samples = evaluate(FLAGS.test_files.split(‘,’), create_model)

in the for loop

for epoch in range(FLAGS.epochs):

in the def train() in train.py

But there is an error that graph is finalized. How do I use current graph to get WER?
Thanks!

You can’t do this, it’s incompatible with how TensorFlow works. You’ll have to set up the testing operations before the graph is finalized, then fetch the appropriate tensors inside the loop and compute WER metrics on them. It’ll require lots of changes to the training code and good understanding of TensorFlow 1.x semantics.

1 Like

OK, shouldn’t waste time doing this I think. Thanks for your reply!