From 03bdeff2ade643c30ad8ebccb25aee22d4a6048f Mon Sep 17 00:00:00 2001 From: hyperzy <50564821+hyperzy@users.noreply.github.com> Date: Thu, 11 Apr 2024 14:56:37 -0400 Subject: [PATCH] Fixed Unexpectedly huge RAM consumption of parallel datamanager (#3060) * Reduced the memory usage by caching image after the datamanager process starts --- nerfstudio/data/datamanagers/parallel_datamanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/data/datamanagers/parallel_datamanager.py b/nerfstudio/data/datamanagers/parallel_datamanager.py index e7521beca..b28e530f9 100644 --- a/nerfstudio/data/datamanagers/parallel_datamanager.py +++ b/nerfstudio/data/datamanagers/parallel_datamanager.py @@ -93,10 +93,10 @@ class DataProcessor(mp.Process): # type: ignore self.exclude_batch_keys_from_device = self.dataset.exclude_batch_keys_from_device self.pixel_sampler = pixel_sampler self.ray_generator = RayGenerator(self.dataset.cameras) - self.cache_images() def run(self): """Append out queue in parallel with ray bundles and batches.""" + self.cache_images() while True: batch = self.pixel_sampler.sample(self.img_data) ray_indices = batch["indices"]