Skip to content

Commit

Permalink
Move value to device before logging for metric (#3649)
Browse files Browse the repository at this point in the history
move value to device before logging for metric
  • Loading branch information
eunwoosh authored Jun 20, 2024
1 parent d96ea1c commit 779a0b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/otx/core/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def _log_metrics(self, meter: Metric, key: Literal["val", "test"], **compute_kwa
warnings.warn(msg, stacklevel=1)
continue

self.log(log_metric_name, value, sync_dist=True, prog_bar=True)
self.log(log_metric_name, value.to(self.device), sync_dist=True, prog_bar=True)

def on_save_checkpoint(self, checkpoint: dict[str, Any]) -> None:
"""Callback on saving checkpoint."""
Expand Down

0 comments on commit 779a0b0

Please sign in to comment.