From 13f6ce418486d30c589c711407bac3268841115c Mon Sep 17 00:00:00 2001 From: Darko Petrovic Date: Mon, 10 Mar 2025 15:10:18 +0100 Subject: [PATCH 1/2] add example for MultiInputPolicy export to onnx --- docs/guide/export.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/guide/export.rst b/docs/guide/export.rst index 88a02fe8b..6cc86133c 100644 --- a/docs/guide/export.rst +++ b/docs/guide/export.rst @@ -100,6 +100,7 @@ If you are using PyTorch 2.0+ and ONNX Opset 14+, you can easily export SB3 poli with th.no_grad(): print(model.policy(th.as_tensor(observation), deterministic=True)) +For ``MultiInputPolicy`` export see example at `GH#1873 `_. For SAC the procedure is similar. The example shown only exports the actor network as the actor is sufficient to roll out the trained policies. From e9e12427c4fbda7160201885af40c4444647f8ec Mon Sep 17 00:00:00 2001 From: Antonin RAFFIN Date: Wed, 12 Mar 2025 15:07:08 +0100 Subject: [PATCH 2/2] Update changelog --- docs/guide/export.rst | 2 +- docs/misc/changelog.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/guide/export.rst b/docs/guide/export.rst index 6cc86133c..a37fb894f 100644 --- a/docs/guide/export.rst +++ b/docs/guide/export.rst @@ -100,7 +100,7 @@ If you are using PyTorch 2.0+ and ONNX Opset 14+, you can easily export SB3 poli with th.no_grad(): print(model.policy(th.as_tensor(observation), deterministic=True)) -For ``MultiInputPolicy`` export see example at `GH#1873 `_. +For exporting ``MultiInputPolicy``, please have a look at `GH#1873 `_. For SAC the procedure is similar. The example shown only exports the actor network as the actor is sufficient to roll out the trained policies. diff --git a/docs/misc/changelog.rst b/docs/misc/changelog.rst index c02a185b3..bb61e2bfd 100644 --- a/docs/misc/changelog.rst +++ b/docs/misc/changelog.rst @@ -44,6 +44,7 @@ Documentation: - Clarify the use of Gym wrappers with ``make_vec_env`` in the section on Vectorized Environments (@pstahlhofen) - Updated callback doc for ``EveryNTimesteps`` - Added doc on how to set env attributes via ``VecEnv`` calls +- Added ONNX export example for ``MultiInputPolicy`` (@darkopetrovic) Release 2.5.0 (2025-01-27)