-
Notifications
You must be signed in to change notification settings - Fork 22
feat(robocasa): integrate RoboCasa kitchen sim alongside LIBERO #289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
akshay18iitg
wants to merge
1
commit into
main
Choose a base branch
from
feat/robocasa_eval_script
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,176 @@ | ||
| { | ||
| "dataset_mixture": { | ||
| "datasets": [ | ||
| { | ||
| "repo_id": "physical-intelligence/libero" | ||
| } | ||
| ], | ||
| "weights": [ | ||
| 1.0 | ||
| ], | ||
| "action_freq": 10.0, | ||
| "image_resample_strategy": "nearest", | ||
| "vector_resample_strategy": "nearest" | ||
| }, | ||
| "policy": { | ||
| "type": "pi05", | ||
| "pretrained_path": "TensorAuto/tPi0.5-base", | ||
| "n_obs_steps": 1, | ||
| "input_features": { | ||
| "camera0": { | ||
| "shape": [ | ||
| 3, | ||
| 224, | ||
| 224 | ||
| ], | ||
| "type": "VISUAL" | ||
| }, | ||
| "camera1": { | ||
| "shape": [ | ||
| 3, | ||
| 224, | ||
| 224 | ||
| ], | ||
| "type": "VISUAL" | ||
| }, | ||
| "camera2": { | ||
| "shape": [ | ||
| 3, | ||
| 224, | ||
| 224 | ||
| ], | ||
| "type": "VISUAL" | ||
| }, | ||
| "state": { | ||
| "shape": [ | ||
| 32 | ||
| ], | ||
| "type": "STATE" | ||
| } | ||
| }, | ||
| "output_features": { | ||
| "actions": { | ||
| "shape": [ | ||
| 32 | ||
| ], | ||
| "type": "ACTION" | ||
| } | ||
| }, | ||
| "normalization_mapping": { | ||
| "VISUAL": "IDENTITY", | ||
| "STATE": "MIN_MAX", | ||
| "ACTION": "MEAN_STD" | ||
| }, | ||
| "chunk_size": 10, | ||
| "n_action_steps": 10, | ||
| "max_state_dim": 32, | ||
| "max_action_dim": 32, | ||
| "proj_width": 1024, | ||
| "num_steps": 10, | ||
| "attention_implementation": "eager", | ||
| "freeze_vision_encoder": true, | ||
| "train_expert_only": true, | ||
| "prompt_max_length": 256, | ||
| "discrete_action_max_length": 60, | ||
| "optimizer_lr": 2.5e-05, | ||
| "optimizer_betas": [ | ||
| 0.9, | ||
| 0.95 | ||
| ], | ||
| "optimizer_eps": 1e-08, | ||
| "optimizer_weight_decay": 1e-10, | ||
| "scheduler_warmup_steps": 1000, | ||
| "scheduler_decay_steps": 30000, | ||
| "scheduler_decay_lr": 2.5e-06 | ||
| }, | ||
| "output_dir": "outputs/pi05_robocasa_eval", | ||
| "resume": false, | ||
| "seed": 1000, | ||
| "resolution": [ | ||
| 224, | ||
| 224 | ||
| ], | ||
| "num_cams": 3, | ||
| "max_state_dim": 32, | ||
| "max_action_dim": 32, | ||
| "action_chunk": 10, | ||
| "loss_weighting": { | ||
| "MSE": 1.0, | ||
| "CE": 1.0 | ||
| }, | ||
| "num_workers": 4, | ||
| "batch_size": 2, | ||
| "gradient_accumulation_steps": 1, | ||
| "dataloader_batch_size": 2, | ||
| "prefetch_factor": 8, | ||
| "steps": 100, | ||
| "log_freq": 1, | ||
| "save_checkpoint": true, | ||
| "save_freq": 100, | ||
| "eval_freq": 10, | ||
| "use_policy_training_preset": true, | ||
| "trace_nans": false, | ||
| "optimizer": { | ||
| "type": "adamw", | ||
| "lr": 2.5e-05, | ||
| "weight_decay": 1e-10, | ||
| "grad_clip_norm": 10.0, | ||
| "betas": [ | ||
| 0.9, | ||
| 0.95 | ||
| ], | ||
| "eps": 1e-08 | ||
| }, | ||
| "env": { | ||
| "type": "robocasa", | ||
| "task": "", | ||
| "fps": 20, | ||
| "max_parallel_tasks": 1, | ||
| "task_ids": [ | ||
| 0, | ||
| 12, | ||
| 267 | ||
| ], | ||
| "episode_length": 150, | ||
| "camera_names": [ | ||
| "robot0_eye_in_hand", | ||
| "robot0_agentview_left", | ||
| "robot0_agentview_right" | ||
| ], | ||
| "camera_height": 256, | ||
| "camera_width": 256, | ||
| "num_steps_wait": 10, | ||
| "render_cam": null, | ||
| "split": "all", | ||
| "seed_base": 0 | ||
| }, | ||
| "eval": { | ||
| "n_episodes": 1, | ||
| "batch_size": 1, | ||
| "use_async_envs": true, | ||
| "max_episodes_rendered": 1, | ||
| "recording_root": null, | ||
| "grid_size": null | ||
| }, | ||
| "scheduler": { | ||
| "type": "cosine_decay_with_warmup", | ||
| "num_warmup_steps": 1000, | ||
| "num_decay_steps": 30000, | ||
| "peak_lr": 2.5e-05, | ||
| "decay_lr": 2.5e-06 | ||
| }, | ||
| "wandb": { | ||
| "enable": true, | ||
| "entity": "wyautox-autox", | ||
| "project": "pi05", | ||
| "run_id": null, | ||
| "name": null, | ||
| "notes": "Evaluating pi0.5 on robocasa", | ||
| "tags": [], | ||
| "group": null, | ||
| "job_type": null, | ||
| "mode": null, | ||
| "allow_resume": true, | ||
| "disable_artifact": false | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,91 @@ | ||
| # Copyright 2026 Tensor Auto Inc. All rights reserved. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| """RoboCasa environment configuration module. | ||
|
|
||
| Mirrors :mod:`opentau.configs.libero` for the RoboCasa kitchen benchmark — extends the | ||
| base training pipeline configuration with RoboCasa-specific evaluation parameters used by | ||
| ``scripts/robocasa_eval/eval.py`` and the bundled-in evaluation hook in | ||
| ``scripts/train.py``. | ||
| """ | ||
|
|
||
| from dataclasses import dataclass | ||
|
|
||
| from opentau.configs.train import TrainPipelineConfig | ||
|
|
||
|
|
||
| @dataclass | ||
| class RoboCasaEvalConfig: | ||
| """Configuration for RoboCasa environment evaluation. | ||
|
|
||
| Args: | ||
| task: Comma-separated RoboCasa task class names (e.g. ``"PnPCounterToCab"``). | ||
| Each name becomes one logical evaluation group, vectorised across rollouts. | ||
| max_steps: Hard cap on policy steps per episode (in addition to ``_check_success``). | ||
| Defaults to 1500. | ||
| chunk_usage: Number of actions to execute per policy call before re-querying. | ||
| If ``None``, defaults to the training config's ``action_chunk``. | ||
| n_simulations: Number of rollouts to run per task. Defaults to 50. | ||
| video_dir: Optional output directory for rollout videos. | ||
| action_dim: Effective action dim sent to RoboCasa (the policy output is | ||
| truncated or zero-padded to this size). Defaults to 16 (PI 0.5 action head). | ||
| seed_base: Starting seed for rollout 0; rollout ``i`` uses ``seed_base + i``. | ||
| camera_height: Off-screen camera height (pixels). Defaults to 256. | ||
| camera_width: Off-screen camera width (pixels). Defaults to 256. | ||
| split: Dataset split passed to ``robocasa.utils.env_utils.create_env``. | ||
|
|
||
| Raises: | ||
| ValueError: If ``task`` is empty. | ||
| """ | ||
|
|
||
| task: str = "PnPCounterToCab" | ||
| max_steps: int = 1500 | ||
| chunk_usage: int | None = None | ||
| n_simulations: int = 50 | ||
| video_dir: str | None = None | ||
| action_dim: int = 16 | ||
| seed_base: int = 0 | ||
| camera_height: int = 256 | ||
| camera_width: int = 256 | ||
| split: str | None = "all" | ||
|
|
||
| def __post_init__(self): | ||
| task_names = [s.strip() for s in str(self.task).split(",") if s.strip()] | ||
| if not task_names: | ||
| raise ValueError("RoboCasaEvalConfig.task must contain at least one task class name.") | ||
| self.task_names = task_names | ||
|
|
||
|
|
||
| @dataclass | ||
| class TrainConfigWithRoboCasaEval(TrainPipelineConfig): | ||
| """Training configuration extended with RoboCasa evaluation settings. | ||
|
|
||
| Args: | ||
| robocasa: Configuration for RoboCasa environment evaluation. Must be provided. | ||
|
|
||
| Raises: | ||
| ValueError: If ``robocasa`` is None or ``chunk_usage`` is outside ``[1, action_chunk]``. | ||
| """ | ||
|
|
||
| robocasa: RoboCasaEvalConfig = None | ||
|
|
||
| def __post_init__(self): | ||
| super().__post_init__() | ||
| if self.robocasa is None: | ||
| raise ValueError("RoboCasa config must be provided.") | ||
| if self.robocasa.chunk_usage is None: | ||
| self.robocasa.chunk_usage = self.action_chunk | ||
| if not 1 <= self.robocasa.chunk_usage <= self.action_chunk: | ||
| raise ValueError( | ||
| f"Chunk usage must be between 1 and {self.action_chunk=}, got {self.robocasa.chunk_usage=}." | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have an example robocasa dataset?