Minor fix (#77)

* minor fix

* lint

---------

Co-authored-by: liangyuxin <liang@ali.com>
This commit is contained in:
liangyuxin42
2025-12-10 16:05:25 +08:00
committed by GitHub
co-authored by liangyuxin
parent 908329d214
commit 05b6d8dcf7
3 changed files with 8 additions and 5 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ pip install -e .
Install wall_x: Install wall_x:
```bash ```bash
git submodule update --init --recursive git submodule update --init --recursive
MAX_JOBS=4 pip install --no-build-isolation --verbose . MAX_JOBS=4 pip install --no-build-isolation --verbose -e .
``` ```
## Training ## Training
+5 -2
View File
@@ -18,14 +18,16 @@ def load_config(config_path):
return config return config
def load_lerobot_dataset(repo_id, action_horizon, args): def load_lerobot_dataset(repo_id, root, action_horizon, args):
dataset_meta = LeRobotDatasetMetadata(repo_id) dataset_meta = LeRobotDatasetMetadata(repo_id)
dataset = LeRobotDataset( dataset = LeRobotDataset(
repo_id, repo_id,
root=root,
delta_timestamps={ delta_timestamps={
key: [t / dataset_meta.fps for t in range(action_horizon)] key: [t / dataset_meta.fps for t in range(action_horizon)]
for key in [KEY_MAPPINGS[repo_id]["action"]] for key in [KEY_MAPPINGS[repo_id]["action"]]
}, },
video_backend="pyav",
) )
num_batches = len(dataset) // args.batch_size num_batches = len(dataset) // args.batch_size
generator = torch.Generator() generator = torch.Generator()
@@ -56,10 +58,11 @@ if __name__ == "__main__":
config = load_config(path) config = load_config(path)
lerobot_config = config["data"]["lerobot_config"] lerobot_config = config["data"]["lerobot_config"]
repo_id = lerobot_config.get("repo_id", None) repo_id = lerobot_config.get("repo_id", None)
root = lerobot_config.get("root", None)
assert repo_id is not None, "repo id is required" assert repo_id is not None, "repo id is required"
action_horizon = config["data"].get("action_horizon", 32) action_horizon = config["data"].get("action_horizon", 32)
data_loader, num_batches = load_lerobot_dataset(repo_id, action_horizon, args) data_loader, num_batches = load_lerobot_dataset(repo_id, root, action_horizon, args)
keys = ["state", "action"] keys = ["state", "action"]
stats = {key: normalize.RunningStats() for key in keys} stats = {key: normalize.RunningStats() for key in keys}
+2 -2
View File
@@ -40,8 +40,8 @@ KEY_MAPPINGS = {
"observation.images.leftImg": "left_wrist_view", "observation.images.leftImg": "left_wrist_view",
"observation.images.rightImg": "right_wrist_view", "observation.images.rightImg": "right_wrist_view",
}, },
"state": "state", "state": "observation.state",
"action": "actions", "action": "action",
}, },
} }