remove set_epoch

resumeO
Laughing-q 2 weeks ago
parent 80ae8d2add
commit 2efc6d7af8
  1. 2
      ultralytics/engine/trainer.py

@ -339,7 +339,7 @@ class BaseTrainer:
self.plot_idx.extend([base_idx, base_idx + 1, base_idx + 2]) self.plot_idx.extend([base_idx, base_idx + 1, base_idx + 2])
epoch = self.start_epoch epoch = self.start_epoch
self.optimizer.zero_grad() # zero any resumed gradients to ensure stability on train start self.optimizer.zero_grad() # zero any resumed gradients to ensure stability on train start
self.train_loader.set_epoch(epoch) # iterate dataloader for resuming # self.train_loader.set_epoch(epoch) # iterate dataloader for resuming, could be extremely slow for large dataset
while True: while True:
self.epoch = epoch self.epoch = epoch
self.run_callbacks("on_train_epoch_start") self.run_callbacks("on_train_epoch_start")

Loading…
Cancel
Save