Skip to content

Commit

Permalink
Merge pull request #120 from IGNF/119-fix-ddp-regression
Browse files Browse the repository at this point in the history
Fix wrong device error created by a breaking change in torch when using DDP
  • Loading branch information
leavauchier committed Apr 24, 2024
2 parents 7a79c1b + 463c3a7 commit 5f876d6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# CHANGELOG

### 3.8.4
- fix: move IoU appropriately to fix wrong device error created by a breaking change in torch when using DDP.

### 3.8.3
- fix: prepare_data_per_node is a flag and was incorrectly used as a replacement for prepare_data.

Expand Down
2 changes: 1 addition & 1 deletion myria3d/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "3.8.3"
__version__ = "3.8.4"


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions myria3d/models/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def training_step(self, batch: Batch, batch_idx: int) -> dict:
return {"loss": loss, "logits": logits, "targets": targets}

def on_train_epoch_end(self) -> None:
iou_epoch = self.train_iou.compute()
iou_epoch = self.train_iou.to(self.device).compute()
self.log("train/iou", iou_epoch, on_step=False, on_epoch=True, prog_bar=True)
self.log_all_class_ious(self.train_iou.confmat, "train")
log_comet_cm(self, self.train_iou.confmat, "train")
Expand Down Expand Up @@ -186,7 +186,7 @@ def on_validation_epoch_end(self) -> None:
outputs : output of validation_step
"""
iou_epoch = self.val_iou.compute()
iou_epoch = self.val_iou.to(self.device).compute()
self.log("val/iou", iou_epoch, on_step=False, on_epoch=True, prog_bar=True)
self.log_all_class_ious(self.val_iou.confmat, "val")
log_comet_cm(self, self.val_iou.confmat, "val")
Expand Down Expand Up @@ -221,7 +221,7 @@ def on_test_epoch_end(self) -> None:
outputs : output of test
"""
iou_epoch = self.test_iou.compute()
iou_epoch = self.test_iou.to(self.device).compute()
self.log("test/iou", iou_epoch, on_step=False, on_epoch=True, prog_bar=True)
self.log_all_class_ious(self.test_iou.confmat, "test")
log_comet_cm(self, self.test_iou.confmat, "test")
Expand Down

0 comments on commit 5f876d6

Please sign in to comment.