fix: 修改 get_published_pretrained_checkpoint 的import方式,兼容Isaaclab版本

This commit is contained in:
syfffffjj
2026-10-20 16:01:15 +08:00
parent 7d290ca6ff
commit ee8963cf4c
@@ -27,7 +27,6 @@ from isaaclab.app import AppLauncher
# local imports # local imports
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
import cli_args import cli_args
from rl_utils import camera_follow
# add argparse arguments # add argparse arguments
parser = argparse.ArgumentParser(description="Train an RL agent with RSL-RL.") parser = argparse.ArgumentParser(description="Train an RL agent with RSL-RL.")
@@ -91,7 +90,11 @@ from isaaclab.envs import (
from isaaclab.managers import ObservationTermCfg as ObsTerm from isaaclab.managers import ObservationTermCfg as ObsTerm
from isaaclab.utils.assets import retrieve_file_path from isaaclab.utils.assets import retrieve_file_path
from isaaclab.utils.dict import print_dict from isaaclab.utils.dict import print_dict
try:
from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkpoint from isaaclab.utils.pretrained_checkpoint import get_published_pretrained_checkpoint
except ModuleNotFoundError:
# Isaac Lab 2.3.x and earlier keep this helper under isaaclab_rl.
from isaaclab_rl.utils.pretrained_checkpoint import get_published_pretrained_checkpoint
from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx from isaaclab_rl.rsl_rl import RslRlOnPolicyRunnerCfg, RslRlVecEnvWrapper, export_policy_as_jit, export_policy_as_onnx
from isaaclab_tasks.utils import get_checkpoint_path from isaaclab_tasks.utils import get_checkpoint_path
from isaaclab_tasks.utils.hydra import hydra_task_config from isaaclab_tasks.utils.hydra import hydra_task_config
@@ -99,6 +102,8 @@ from isaaclab_tasks.utils.hydra import hydra_task_config
import rl_training import rl_training
import rl_training.tasks # noqa: F401 import rl_training.tasks # noqa: F401
from rl_utils import camera_follow
print(f"[INFO] Using rl_training package from: {rl_training.__file__}") print(f"[INFO] Using rl_training package from: {rl_training.__file__}")