From ee785881ddddd26124e9162bfc73a7387bd29d95 Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Thu, 27 Mar 2025 18:00:55 +0100 Subject: [PATCH 1/2] Fixed modification of default value Fixed instantiation of VanillaDataManager to avoid modifying the default values of exclude_batch_keys_from_device. In previous implementation, if masks_on_gpu is true, values are removed from the array. However, the variable contains a reference to the default array in InputDataset. Therefore, the default array is modified, and next instantiations of any InputDataset will have a truncated array without the removed value. Next VanillaDataManager instantiation will then fail to remove the value from the array (because the array does not have it anymore) and will raise an exception aborting everything. --- nerfstudio/data/datamanagers/base_datamanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nerfstudio/data/datamanagers/base_datamanager.py b/nerfstudio/data/datamanagers/base_datamanager.py index 833c6044cd..bb33ae9d7f 100644 --- a/nerfstudio/data/datamanagers/base_datamanager.py +++ b/nerfstudio/data/datamanagers/base_datamanager.py @@ -381,7 +381,7 @@ def __init__( self.train_dataset = self.create_train_dataset() self.eval_dataset = self.create_eval_dataset() - self.exclude_batch_keys_from_device = self.train_dataset.exclude_batch_keys_from_device + self.exclude_batch_keys_from_device = list(self.train_dataset.exclude_batch_keys_from_device) if self.config.masks_on_gpu is True and "mask" in self.exclude_batch_keys_from_device: self.exclude_batch_keys_from_device.remove("mask") if self.config.images_on_gpu is True and "image" in self.exclude_batch_keys_from_device: From a55c0f6e3c326342154cefa7b8212c7965b135be Mon Sep 17 00:00:00 2001 From: Leo Terziman Date: Thu, 27 Mar 2025 18:02:55 +0100 Subject: [PATCH 2/2] Fix update of default values in ParallelDataManager Fixed instantiation of ParallelDataManager to avoid modifying the default values of exclude_batch_keys_from_device. In previous implementation, if masks_on_gpu is true, values are removed from the array. However, the variable contains a reference to the default array in InputDataset. Therefore, the default array is modified, and next instantiations of any InputDataset will have a truncated array without the removed value. Next ParallelDataManager instantiation will then fail to remove the value from the array (because the array does not have it anymore) and will raise an exception aborting everything. --- 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 fe3a62f3c4..3137eada62 100644 --- a/nerfstudio/data/datamanagers/parallel_datamanager.py +++ b/nerfstudio/data/datamanagers/parallel_datamanager.py @@ -108,7 +108,7 @@ def __init__( self.train_dataparser_outputs: DataparserOutputs = self.dataparser.get_dataparser_outputs(split="train") self.train_dataset = self.create_train_dataset() self.eval_dataset = self.create_eval_dataset() - self.exclude_batch_keys_from_device = self.train_dataset.exclude_batch_keys_from_device + self.exclude_batch_keys_from_device = list(self.train_dataset.exclude_batch_keys_from_device) if self.config.masks_on_gpu is True and "mask" in self.exclude_batch_keys_from_device: self.exclude_batch_keys_from_device.remove("mask") if self.config.images_on_gpu is True and "image" in self.exclude_batch_keys_from_device: