Add clearml logging (#51)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Ayush Chaurasia 2022-11-24 19:55:03 +05:30 committed by GitHub
parent 512a225ce8
commit 298287298d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 119 additions and 69 deletions

View file

@ -24,6 +24,7 @@ class BaseValidator:
self.cuda = self.device.type != 'cpu'
self.batch_i = None
self.training = True
self.loss = None
def __call__(self, trainer=None, model=None):
"""
@ -44,7 +45,7 @@ class BaseValidator:
model.eval()
dt = Profile(), Profile(), Profile(), Profile()
loss = 0
self.loss = 0
n_batches = len(self.dataloader)
desc = self.get_desc()
bar = tqdm(self.dataloader, desc, n_batches, not self.training, bar_format=TQDM_BAR_FORMAT)
@ -65,7 +66,7 @@ class BaseValidator:
# loss
with dt[2]:
if self.training:
loss += trainer.criterion(preds, batch)[0]
self.loss += trainer.criterion(preds, batch)[0]
# pre-process predictions
with dt[3]: