fix multiple dirs in DDP mode (#113)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Laughing-q <1185102784@qq.com>
This commit is contained in:
@ -45,7 +45,7 @@ class ClassificationTrainer(BaseTrainer):
|
||||
return batch
|
||||
|
||||
def get_validator(self):
|
||||
return v8.classify.ClassificationValidator(self.test_loader, self.device, logger=self.console)
|
||||
return v8.classify.ClassificationValidator(self.test_loader, self.save_dir, logger=self.console)
|
||||
|
||||
def criterion(self, preds, batch):
|
||||
loss = torch.nn.functional.cross_entropy(preds, batch["cls"])
|
||||
|
@ -171,7 +171,7 @@ class DetectionValidator(BaseValidator):
|
||||
pad=0.5,
|
||||
rect=self.args.rect,
|
||||
workers=self.args.workers,
|
||||
prefix=colorstr(f'{val}: '),
|
||||
prefix=colorstr(f'{self.args.mode}: '),
|
||||
shuffle=False,
|
||||
seed=self.args.seed)[0] if self.args.v5loader else \
|
||||
build_dataloader(self.args, batch_size, img_path=dataset_path, stride=gs, mode="val")[0]
|
||||
|
Reference in New Issue
Block a user