Skip to content
Snippets Groups Projects
Commit 69b306a9 authored by Michael Langguth's avatar Michael Langguth
Browse files

Final fix to handling losses in main_train_models.py.

parent 375d91e5
Branches
No related tags found
No related merge requests found
Pipeline #75888 passed
......@@ -312,13 +312,12 @@ class TrainModel(object):
self.results = sess.run(self.fetches) # ...and run it here!
# Note: For SAVP, the obtained loss is a list where the first element is of interest, for convLSTM,
# it's just a number. Thus, with list(<losses>)[0], we can handle both
train_losses.append(self.results[list(self.saver_loss)[0]])
train_losses.append(list(self.results[self.saver_loss])[0])
# run and fetch losses for validation data
val_handle_eval = sess.run(self.val_handle)
self.create_fetches_for_val()
self.val_results = sess.run(self.val_fetches, feed_dict={self.train_handle: val_handle_eval})
val_losses.append(self.val_results[list(self.saver_loss)[0]])
print(val_losses)
val_losses.append(list(self.val_results[self.saver_loss])[0])
self.write_to_summary()
self.print_results(step, self.results)
# track iteration time
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment