Consistent early exit logic for validation loop in Fabric Trainer example #17962

This commit is contained in:
jere357 2023-07-03 14:26:50 +02:00 committed by GitHub
parent 658e1aba26
commit 28007bd076
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -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)