Does self.log(..., on_epoch=True)
cost the same time as torchmetrics.Accuracy
in distributed mode?
#9172
Unanswered
marsggbo
asked this question in
DDP / multi-GPU / multi-node
Replies: 1 comment
-
You are right that this is duplicating the calculation. Instead, try logging the def training_step(self, batch: Any, batch_idx: int):
...
self.train_accuracy(predictions, targets)
self.log('train/acc', self.train_accuracy, on_step=True, on_epoch=True) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In pl, there are two methods to calculate the accuracy of distributed mode. As shown in the above code, it seems that we calculate the accuracy twice, which wastes a lot of time. Therefore, I wonder how to save time in calculating the distributed metrics if we want to log and obtain the value of the metrics.
Beta Was this translation helpful? Give feedback.
All reactions