mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-12-02 13:59:10 +08:00
Reduce GPU memory usage in CacheDataloader (#1730)
* Reduce GPU memory usage in CacheDataloader * Move also masks and seg.masks, depths to cpu * Fix linter issues
This commit is contained in:
1 parent
d4b04376ab
commit
3b0f7581d8
10 files changed
+29
-11
No files matched your search
@@ -254,7 +254,7 @@ class SemanticNerfWModel(Model):
|
||||
|
||||
# semantic loss
|
||||
loss_dict["semantics_loss"] = self.config.semantic_loss_weight * self.cross_entropy_loss(
|
||||
outputs["semantics"], batch["semantics"][..., 0].long()
|
||||
outputs["semantics"], batch["semantics"][..., 0].long().to(self.device)
|
||||
)
|
||||
return loss_dict
|
||||
|
||||
@@ -301,6 +301,6 @@ class SemanticNerfWModel(Model):
|
||||
images_dict["semantics_colormap"] = self.colormap.to(self.device)[semantic_labels]
|
||||
|
||||
# valid mask
|
||||
images_dict["mask"] = batch["mask"].repeat(1, 1, 3)
|
||||
images_dict["mask"] = batch["mask"].repeat(1, 1, 3).to(self.device)
|
||||
|
||||
return metrics_dict, images_dict
|
||||
Reference in new issue
Block a user