Skip to content
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

Clarifying the documentation for custom env using images as observations #2085

Merged
merged 1 commit into from
Feb 20, 2025
Merged
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
4 changes: 2 additions & 2 deletions docs/guide/custom_env.rst
Original file line number Diff line number Diff line change
@@ -9,8 +9,8 @@ That is to say, your environment must implement the following methods (and inher

.. note::

If you are using images as input, the observation must be of type ``np.uint8`` and be contained in [0, 255].
By default, the observation is normalized by SB3 pre-processing (dividing by 255 to have values in [0, 1]) when using CNN policies.
If you are using images as input, the observation must be of type ``np.uint8`` and be within a space ``Box`` bounded by [0, 255] (``Box(low=0, high=255, shape=(<your image shape>)``).
By default, the observation is normalized by SB3 pre-processing (dividing by 255 to have values in [0, 1], i.e. ``Box(low=0, high=1)``) when using CNN policies.
Images can be either channel-first or channel-last.

If you want to use ``CnnPolicy`` or ``MultiInputPolicy`` with image-like observation (3D tensor) that are already normalized, you must pass ``normalize_images=False``