Skip to content

Commit

Permalink
Fixed Unexpectedly huge RAM consumption of parallel datamanager (nerf…
Browse files Browse the repository at this point in the history
…studio-project#3060)

* Reduced the memory usage by caching image after the datamanager process starts
  • Loading branch information
hyperzy committed Apr 11, 2024
1 parent 4714ae7 commit 03bdeff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nerfstudio/data/datamanagers/parallel_datamanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def __init__(
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"]
Expand Down

0 comments on commit 03bdeff

Please sign in to comment.