Skip to content

Commit 19b27fe

Browse files
authored
Update dataset.py
This commit ensures that the log displays the correct dataset size when fine-tuning on different HDF5VLADataset. logs refer to https://github.com/huangxu1991/RoboticsDiffusionTransformer/blob/main/train/train.py#L335C1-L336C1
1 parent b2889e6 commit 19b27fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

train/dataset.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ def _load_data_from_chunk(chunk_dir, chunk_item_idx):
188188
raise RuntimeError("Failed to load sample.")
189189

190190
def __len__(self) -> int:
191-
return self.num_chunks * self.chunk_size
191+
if self.use_hdf5:
192+
return len(self.hdf5_dataset)
193+
else:
194+
return self.num_chunks * self.chunk_size
192195

193196
def _safe_load(self, index):
194197
read_chunk_item_indices = []

0 commit comments

Comments
 (0)