mirror of
https://github.com/huggingface/lerobot.git
synced 2026-07-26 19:26:16 +00:00
fix(robocasa): override RoboCasaGymEnv default split (test -> all)
RoboCasaGymEnv defaults split="test", but create_env only accepts
{None, "all", "pretrain", "target"}, so the out-of-the-box default
crashes with ValueError. Always pass "all" when split is None.
Made-with: Cursor
This commit is contained in:
@@ -182,13 +182,15 @@ class RoboCasaEnv(gym.Env):
|
||||
return
|
||||
from robocasa.wrappers.gym_wrapper import RoboCasaGymEnv
|
||||
|
||||
# RoboCasaGymEnv has a broken default split="test" (invalid for create_env
|
||||
# which only accepts None/"all"/"pretrain"/"target"). Always pass a valid
|
||||
# value so we don't hit that default.
|
||||
kwargs: dict[str, Any] = {
|
||||
"env_name": self.task,
|
||||
"camera_widths": self.observation_width,
|
||||
"camera_heights": self.observation_height,
|
||||
"split": self.split if self.split is not None else "all",
|
||||
}
|
||||
if self.split is not None:
|
||||
kwargs["split"] = self.split
|
||||
|
||||
self._env = RoboCasaGymEnv(**kwargs)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user