reduced mem on train; figuring out memory leak on visualizer

This commit is contained in:
evonneng committed 2022-09-13 03:22:07 +00:00
1 parent 416669d808
commit 139da13be8
12 files changed
+22 -13

No files matched your search

+2
View File
@@ -251,6 +251,8 @@ class VanillaDataManager(DataManager): # pylint: disable=abstract-method
self.train_input_dataset,
num_images_to_sample_from=self.config.train_num_images_to_sample_from,
device=self.device,
num_workers=self.world_size * 4,
pin_memory=True,
)
self.iter_train_image_dataloader = iter(self.train_image_dataloader)
self.train_pixel_sampler = PixelSampler(self.config.train_num_rays_per_batch)
+2 -2
View File
@@ -77,7 +77,7 @@ class CacheImageDataloader(DataLoader):
"""Returns a collated batch."""
batch_list = self._get_batch_list()
collated_batch = default_collate(batch_list)
collated_batch = get_dict_to_torch(collated_batch, device=self.device)
collated_batch = get_dict_to_torch(collated_batch, device=self.device, exclude=["image"])
return collated_batch
def __iter__(self):
@@ -162,7 +162,7 @@ class EvalDataloader(DataLoader):
ray_bundle.num_rays_per_chunk = self.num_rays_per_chunk
ray_bundle.camera_indices = torch.Tensor([image_idx])[..., None].int()
batch = self.input_dataset[image_idx]
batch = get_dict_to_torch(batch, device=self.device)
batch = get_dict_to_torch(batch, device=self.device, exclude=["image"])
return ray_bundle, batch