Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set lower validation batch size for yolov8 #1629

Merged
merged 8 commits into from
Jun 20, 2023
4 changes: 4 additions & 0 deletions src/sparseml/yolov8/trainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ def _setup_train(self, rank, world_size):
super()._setup_train(rank, world_size)
# NOTE: self.resume_training() was called in ^

if rank in {0, -1}:
self.test_loader = self.get_dataloader(self.testset, batch_size=max(1, self.train_loader.batch_size // 4), rank=-1, mode='val')
abhinavnmagic marked this conversation as resolved.
Show resolved Hide resolved
self.validator = self.get_validator()

if rank in {0, -1}:
config = dict(self.args)
if self.manager is not None:
Expand Down
Loading