You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use new AccuracyMetric, it can automatically sync in ddp, but it doesn't divide by word_size. In manually mode, I can divide it by word_size by hand in validation_epoch_end. But if I use EvalResult, how to do this? It only do mean across batches, but no across gpus.
This is original code:
def validation_epoch_end(self, outputs):
avg_loss = torch.stack([x['val_loss'] for x in outputs]).mean()
avg_acc = torch.stack([x['acc'] for x in outputs]).mean()
avg_acc = avg_acc / self.trainer.world_size
The text was updated successfully, but these errors were encountered:
@xiadingZ this was solved in a recent PR (#2568). You can now set the reduce_op='avg' when you construct the metric, and it will calculate the mean and not the sum.
I want to use new
AccuracyMetric
, it can automatically sync in ddp, but it doesn't divide byword_size
. In manually mode, I can divide it byword_size
by hand invalidation_epoch_end
. But if I useEvalResult
, how to do this? It only domean
across batches, but no across gpus.This is original code:
The text was updated successfully, but these errors were encountered: