Move utils
This commit is contained in:
parent
a61dd152b1
commit
73083269cb
|
@ -7,7 +7,7 @@ from pathlib import Path
|
|||
|
||||
from huggingface_hub import snapshot_download
|
||||
|
||||
from lerobot.common.utils import init_hydra_config
|
||||
from lerobot.common.utils.utils import init_hydra_config
|
||||
from lerobot.scripts.eval import eval
|
||||
|
||||
# Get a pretrained policy from the hub.
|
||||
|
|
|
@ -13,7 +13,7 @@ from omegaconf import OmegaConf
|
|||
from lerobot.common.datasets.factory import make_dataset
|
||||
from lerobot.common.policies.diffusion.configuration_diffusion import DiffusionConfig
|
||||
from lerobot.common.policies.diffusion.modeling_diffusion import DiffusionPolicy
|
||||
from lerobot.common.utils import init_hydra_config
|
||||
from lerobot.common.utils.utils import init_hydra_config
|
||||
|
||||
output_directory = Path("outputs/train/example_pusht_diffusion")
|
||||
os.makedirs(output_directory, exist_ok=True)
|
||||
|
|
|
@ -2,7 +2,7 @@ import inspect
|
|||
|
||||
from omegaconf import DictConfig, OmegaConf
|
||||
|
||||
from lerobot.common.utils import get_safe_torch_device
|
||||
from lerobot.common.utils.utils import get_safe_torch_device
|
||||
|
||||
|
||||
def _policy_cfg_from_hydra_cfg(policy_cfg_class, hydra_cfg):
|
||||
|
|
|
@ -11,7 +11,7 @@ import torch.nn as nn
|
|||
|
||||
import lerobot.common.policies.tdmpc.helper as h
|
||||
from lerobot.common.policies.utils import populate_queues
|
||||
from lerobot.common.utils import get_safe_torch_device
|
||||
from lerobot.common.utils.utils import get_safe_torch_device
|
||||
|
||||
FIRST_FRAME = 0
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ from lerobot.common.envs.factory import make_env
|
|||
from lerobot.common.envs.utils import postprocess_action, preprocess_observation
|
||||
from lerobot.common.logger import log_output_dir
|
||||
from lerobot.common.policies.factory import make_policy
|
||||
from lerobot.common.utils import get_safe_torch_device, init_hydra_config, init_logging, set_global_seed
|
||||
from lerobot.common.utils.utils import get_safe_torch_device, init_hydra_config, init_logging, set_global_seed
|
||||
|
||||
|
||||
def write_video(video_path, stacked_frames, fps):
|
||||
|
|
|
@ -13,7 +13,7 @@ from lerobot.common.datasets.utils import cycle
|
|||
from lerobot.common.envs.factory import make_env
|
||||
from lerobot.common.logger import Logger, log_output_dir
|
||||
from lerobot.common.policies.factory import make_policy
|
||||
from lerobot.common.utils import (
|
||||
from lerobot.common.utils.utils import (
|
||||
format_big_number,
|
||||
get_safe_torch_device,
|
||||
init_logging,
|
||||
|
|
|
@ -9,7 +9,7 @@ import torch
|
|||
|
||||
from lerobot.common.datasets.factory import make_dataset
|
||||
from lerobot.common.logger import log_output_dir
|
||||
from lerobot.common.utils import init_logging
|
||||
from lerobot.common.utils.utils import init_logging
|
||||
|
||||
NUM_EPISODES_TO_RENDER = 50
|
||||
MAX_NUM_STEPS = 1000
|
||||
|
|
|
@ -3,7 +3,7 @@ import pytest
|
|||
import lerobot
|
||||
import gymnasium as gym
|
||||
|
||||
from lerobot.common.import_utils import is_package_available
|
||||
from lerobot.common.utils.import_utils import is_package_available
|
||||
from lerobot.common.policies.act.modeling_act import ActionChunkingTransformerPolicy
|
||||
from lerobot.common.policies.diffusion.modeling_diffusion import DiffusionPolicy
|
||||
from lerobot.common.policies.tdmpc.policy import TDMPCPolicy
|
||||
|
@ -13,7 +13,7 @@ from lerobot.common.policies.tdmpc.policy import TDMPCPolicy
|
|||
def test_available_env_task(env_name: str, task_name: list):
|
||||
"""
|
||||
This test verifies that all environments listed in `lerobot/__init__.py` can
|
||||
be sucessfully imported if — they're installed — and that their
|
||||
be sucessfully imported — if they're installed — and that their
|
||||
`available_tasks_per_env` are valid.
|
||||
"""
|
||||
package_name = f"gym_{env_name}"
|
||||
|
|
|
@ -7,7 +7,7 @@ import torch
|
|||
import lerobot
|
||||
from lerobot.common.datasets.utils import compute_stats, get_stats_einops_patterns, load_previous_and_future_frames
|
||||
from lerobot.common.transforms import Prod
|
||||
from lerobot.common.utils import init_hydra_config
|
||||
from lerobot.common.utils.utils import init_hydra_config
|
||||
import logging
|
||||
from lerobot.common.datasets.factory import make_dataset
|
||||
from datasets import Dataset
|
||||
|
|
|
@ -6,8 +6,8 @@ import gymnasium as gym
|
|||
from gymnasium.utils.env_checker import check_env
|
||||
|
||||
from lerobot.common.envs.factory import make_env
|
||||
from lerobot.common.import_utils import is_package_available
|
||||
from lerobot.common.utils import init_hydra_config
|
||||
from lerobot.common.utils.import_utils import is_package_available
|
||||
from lerobot.common.utils.utils import init_hydra_config
|
||||
|
||||
import lerobot
|
||||
from lerobot.common.envs.utils import preprocess_observation
|
||||
|
|
|
@ -7,7 +7,7 @@ from lerobot.common.policies.factory import make_policy
|
|||
from lerobot.common.policies.policy_protocol import Policy
|
||||
from lerobot.common.envs.factory import make_env
|
||||
from lerobot.common.datasets.factory import make_dataset
|
||||
from lerobot.common.utils import init_hydra_config
|
||||
from lerobot.common.utils.utils import init_hydra_config
|
||||
from .utils import DEVICE, DEFAULT_CONFIG_PATH
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue