set num workers to zero in compute stats, temporary fix to hanging code when iterating over dataloader
This commit is contained in:
@@ -160,9 +160,8 @@ def to_lerobotdataset_with_save_episode(raw_dir: Path, repo_id: str, push_to_hub
|
|||||||
|
|
||||||
for key in other_keys:
|
for key in other_keys:
|
||||||
if "language_instruction" in key:
|
if "language_instruction" in key:
|
||||||
continue
|
|
||||||
# Some openx dataset have multiple language commands
|
# Some openx dataset have multiple language commands
|
||||||
# episode_data[key] = episode[key].numpy()[0].decode("utf-8")
|
episode_data[key] = episode[key].numpy()[0].decode("utf-8")
|
||||||
else:
|
else:
|
||||||
if key == "is_last":
|
if key == "is_last":
|
||||||
episode_data["next.done"] = tf_to_torch(episode[key])
|
episode_data["next.done"] = tf_to_torch(episode[key])
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ def get_stats_einops_patterns(dataset, num_workers=0):
|
|||||||
|
|
||||||
Note: We assume the images are in channel first format
|
Note: We assume the images are in channel first format
|
||||||
"""
|
"""
|
||||||
|
|
||||||
dataloader = torch.utils.data.DataLoader(
|
dataloader = torch.utils.data.DataLoader(
|
||||||
dataset,
|
dataset,
|
||||||
num_workers=num_workers,
|
num_workers=num_workers,
|
||||||
|
|||||||
@@ -895,7 +895,7 @@ class LeRobotDataset(torch.utils.data.Dataset):
|
|||||||
if run_compute_stats:
|
if run_compute_stats:
|
||||||
self.stop_image_writer()
|
self.stop_image_writer()
|
||||||
# TODO(aliberts): refactor stats in save_episodes
|
# TODO(aliberts): refactor stats in save_episodes
|
||||||
self.meta.stats = compute_stats(self)
|
self.meta.stats = compute_stats(self, num_workers=0)
|
||||||
serialized_stats = serialize_dict(self.meta.stats)
|
serialized_stats = serialize_dict(self.meta.stats)
|
||||||
write_json(serialized_stats, self.root / STATS_PATH)
|
write_json(serialized_stats, self.root / STATS_PATH)
|
||||||
self.consolidated = True
|
self.consolidated = True
|
||||||
|
|||||||
Reference in New Issue
Block a user