Fix ClearML Mosaic callback to 'on_train_epoch_end' (#92)

This commit is contained in:
Glenn Jocher
2022-12-25 17:04:24 +01:00
committed by GitHub
parent 0298821467
commit 249dfbdc05
5 changed files with 17 additions and 24 deletions

View File

@ -63,16 +63,15 @@ class DetectionTrainer(BaseTrainer):
return dict(zip(keys, loss_items)) if loss_items is not None else keys
def progress_string(self):
return ('\n' + '%11s' * 7) % \
('Epoch', 'GPU_mem', *self.loss_names, 'Instances', 'Size')
return ('\n' + '%11s' * 7) % ('Epoch', 'GPU_mem', *self.loss_names, 'Instances', 'Size')
def plot_training_samples(self, batch, ni):
images = batch["img"]
cls = batch["cls"].squeeze(-1)
bboxes = batch["bboxes"]
paths = batch["im_file"]
batch_idx = batch["batch_idx"]
plot_images(images, batch_idx, cls, bboxes, paths=paths, fname=self.save_dir / f"train_batch{ni}.jpg")
plot_images(images=batch["img"],
batch_idx=batch["batch_idx"],
cls=batch["cls"].squeeze(-1),
bboxes=batch["bboxes"],
paths=batch["im_file"],
fname=self.save_dir / f"train_batch{ni}.jpg")
def plot_metrics(self):
plot_results(file=self.csv) # save results.png

View File

@ -214,8 +214,7 @@ class SegmentationTrainer(DetectionTrainer):
return dict(zip(keys, loss_items)) if loss_items is not None else keys
def progress_string(self):
return ('\n' + '%11s' * 8) % \
('Epoch', 'GPU_mem', *self.loss_names, 'Instances', 'Size')
return ('\n' + '%11s' * 8) % ('Epoch', 'GPU_mem', *self.loss_names, 'Instances', 'Size')
def plot_training_samples(self, batch, ni):
images = batch["img"]