-
Notifications
You must be signed in to change notification settings - Fork 3.9k
added failure if users try to determine export method for direct rl e… #7081
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
Changes from 1 commit
f78d321
39d6e4f
54a62cf
3503b93
3f758b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -284,11 +284,18 @@ def export_sb3_agent( | |
| try: | ||
| env = gym.make(args_cli.task, cfg=env_cfg, render_mode=None) | ||
| if not isinstance(env.unwrapped, ManagerBasedRLEnv): | ||
| if args_cli.export_method is not None: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Warning · Implementation — SB3 direct-env error masks unsupported-environment message SB3 LEAPP export does not support direct environments at all (the following |
||
| raise ValueError( | ||
| "--export_method is only supported for manager-based environments. For direct environments, " | ||
| "set export_with directly in the annotate.output_tensors() call instead." | ||
| ) | ||
| raise NotImplementedError("SB3 LEAPP export currently supports manager-based environments only.") | ||
|
|
||
| export_method = "onnx-dynamo" if args_cli.export_method is None else args_cli.export_method | ||
|
|
||
| policy_node_name = ensure_env_spec_id(env) | ||
| graph_name = args_cli.export_task_name if args_cli.export_task_name is not None else task_name | ||
| patch_env_for_export(env, export_method=args_cli.export_method, required_obs_groups={"policy"}) | ||
| patch_env_for_export(env, export_method=export_method, required_obs_groups={"policy"}) | ||
|
|
||
| print(f"[INFO] Loading model checkpoint from: {checkpoint_path}") | ||
| agent = _load_agent(checkpoint_path, device=env.unwrapped.device) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| Fixed | ||
| ^^^^^ | ||
|
|
||
| * Raised an error when ``--export_method`` is used to export a direct RL environment with LEAPP. |
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.
🔵 Suggestion · Api — Unrelated pt2 choice added without documentation
Adding
"pt2"widens the accepted values of the public--export_methodflag and is forwarded verbatim topatch_env_for_export, but it is unrelated to this change's stated purpose and appears in neither the help text nor the changelog fragment. Either drop it from this change or document it in the help string and changelog alongside the supporting backend support.