Skip to content

Commit 9d38fe3

Browse files
committed
resolve a bug
1 parent a9e79b0 commit 9d38fe3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pytorch_lightning/trainer/training_loop.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ def training_step(self, split_batch, batch_idx, opt_idx, hiddens):
296296
self.trainer.logger_connector.cache_logged_metrics()
297297

298298
self._check_training_step_output(training_step_output)
299+
300+
print()
301+
print("training_step", training_step_output)
299302

300303
training_step_output = self.trainer.call_hook("training_step_end", training_step_output)
301304

@@ -514,8 +517,13 @@ def run_training_epoch(self):
514517
# VALIDATE IF NEEDED + CHECKPOINT CALLBACK
515518
# -----------------------------------------
516519
should_check_val = self.should_check_val_fx(batch_idx, is_last_batch)
520+
521+
print("should_check_val")
522+
517523
if should_check_val:
524+
print("STARTING EVALUTION")
518525
self.trainer.run_evaluation()
526+
print("FINISHED EVALUTION")
519527
val_loop_called = True
520528

521529
# reset stage to train
@@ -577,7 +585,7 @@ def run_training_epoch(self):
577585
self.trainer.run_evaluation(on_epoch=True)
578586

579587
# reset stage to train
580-
self.trainer._running_stage = RunningStage.TRAINING
588+
self.trainer._set_running_stage(RunningStage.TRAINING, self.trainer.lightning_module)
581589

582590
# increment the global step once
583591
# progress global step according to grads progress

0 commit comments

Comments
 (0)