Consistent early exit logic for validation loop in Fabric Trainer example #17962
This commit is contained in:
parent
658e1aba26
commit
28007bd076
|
@ -216,8 +216,7 @@ class MyCustomTrainer:
|
|||
for batch_idx, batch in enumerate(iterable):
|
||||
# end epoch if stopping training completely or max batches for this epoch reached
|
||||
if self.should_stop or batch_idx >= limit_batches:
|
||||
self.fabric.call("on_train_epoch_end")
|
||||
return
|
||||
break
|
||||
|
||||
self.fabric.call("on_train_batch_start", batch, batch_idx)
|
||||
|
||||
|
|
Loading…
Reference in New Issue