Refactor configs to have env in seperate yaml + Fix training

这个提交包含在:
Cadene
2024-02-25 17:42:47 +00:00
父节点 eec134d72b
当前提交 b16c334825
共有 13 个文件被更改,包括 146 次插入 和 54 次删除

17
tests/test_datasets.py 普通文件
查看文件

@ -0,0 +1,17 @@
import pytest
from lerobot.common.datasets.factory import make_offline_buffer
from .utils import init_config
@pytest.mark.parametrize(
"env_name",
[
"simxarm",
"pusht",
],
)
def test_factory(env_name):
cfg = init_config(overrides=[f"env={env_name}"])
offline_buffer = make_offline_buffer(cfg)

查看文件

@ -78,13 +78,13 @@ def test_pusht(from_pixels, pixels_only):
@pytest.mark.parametrize(
"config_name",
"env_name",
[
"default",
"simxarm",
"pusht",
],
)
def test_factory(config_name):
cfg = init_config(config_name)
def test_factory(env_name):
cfg = init_config(overrides=[f"env={env_name}"])
env = make_env(cfg)
check_env_specs(env)

查看文件

@ -6,12 +6,12 @@ from .utils import init_config
@pytest.mark.parametrize(
"config_name",
"env_name",
[
"default",
"simxarm",
"pusht",
],
)
def test_factory(config_name):
cfg = init_config(config_name)
def test_factory(env_name):
cfg = init_config(overrides=[f"env={env_name}"])
policy = make_policy(cfg)

查看文件

@ -4,8 +4,8 @@ from hydra import compose, initialize
CONFIG_PATH = "../lerobot/configs"
def init_config(config_name):
def init_config(config_name="default", overrides=None):
hydra.core.global_hydra.GlobalHydra.instance().clear()
initialize(config_path=CONFIG_PATH)
cfg = compose(config_name=config_name)
cfg = compose(config_name=config_name, overrides=overrides)
return cfg