Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ git+https://github.com/ZhengyiLuo/SMPLSim.git@dd65a86
easydict
warp-lang
dataclass-wizard
onnxscript

-e neural_wbc/core
-e neural_wbc/data
Expand Down
7 changes: 7 additions & 0 deletions scripts/rsl_rl/players.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ def __init__(self, args_cli: argparse.Namespace, randomize: bool, custom_config:
student_cfg = StudentPolicyTrainerCfg(**config_dict)
student_trainer = StudentPolicyTrainer(env=self.wrapped_env, cfg=student_cfg)
self.policy = student_trainer.get_inference_policy(device=self.env.device)

# export student policy to onnx
onnx_program = torch.onnx.export(self.policy, self.wrapped_env.get_observations(), dynamo=True)
export_model_dir = os.path.join(student_path, "exported")
os.makedirs(export_model_dir, exist_ok=True)
onnx_program.save(os.path.join(export_model_dir, "policy.onnx"))

else:
raise ValueError("student_policy.resume_path is needed for play or eval. Please specify a value.")
else:
Expand Down