You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question] It takes too much time when store camera data into EpisodeData #2710
sub_keys = key.split("/")
current_dataset_pointer = self._data
for sub_key_index in range(len(sub_keys)):
if sub_key_index == len(sub_keys) - 1:
# Add value to the final dict layer
if sub_keys[sub_key_index] not in current_dataset_pointer:
current_dataset_pointer[sub_keys[sub_key_index]] = value.unsqueeze(0).clone()
else:
current_dataset_pointer[sub_keys[sub_key_index]] = torch.cat(
(current_dataset_pointer[sub_keys[sub_key_index]], value.unsqueeze(0))
)
break
# key index
if sub_keys[sub_key_index] not in current_dataset_pointer:
current_dataset_pointer[sub_keys[sub_key_index]] = dict()
current_dataset_pointer = current_dataset_pointer[sub_keys[sub_key_index]]
In each simulation step, the image data would be stored into a single tensor variable by calling tensor.cat(...). It would take too much time when the image size is large.
Does anyone has suggestions, good idea to solve this problem?
Activity
RandomOakForest commentedon Jun 23, 2025
Thank you for posting this. I'll move this post to our Discussions for follow up. In the meantime, here are a few things to try:
1. Preallocate Storage Space
Instead of concatenating tensors at each step, preallocate a fixed-size tensor for the entire episode:
2. Use HDF5 Chunking and Compression
Modify HDF5 storage parameters for better performance:
Key optimizations:
chunks=(1, ...)matches write patterncompression="gzip"reduces storage (3-5x smaller)dtype="uint8"for RGB images3. Reduce Image Resolution
Where acceptable, lower camera resolution. Storage scales quadratically with resolution - 320x240 uses ~4x less space than 640x480.