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

improve docs adding "--gym-packages" argument #445

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

turbotimon
Copy link

@turbotimon turbotimon commented Apr 23, 2024

Description

improve doc adding "--gym-packages" argument

source:

parser.add_argument(
"--gym-packages",
type=str,
nargs="+",
default=[],
help="Additional external Gym environment package modules to import",

Motivation and Context

  • I have raised an issue to propose this change (required for new features and bug fixes)

Types of changes

  • Documentation (update in the documentation)

Checklist:

  • I've read the CONTRIBUTION guide (required)
  • I have updated the documentation accordingly.

@@ -4,7 +4,7 @@
Custom Environment
==================

The easiest way to add support for a custom environment is to edit
The easiest way to add support for a custom or external environment is to import it using the ``--gym-packages my_custom_env`` argument or to edit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
The easiest way to add support for a custom or external environment is to import it using the ``--gym-packages my_custom_env`` argument or to edit
The easiest way to add support for a custom or external environment is to import it using the ``--gym-packages my_package`` argument or to edit

Copy link
Member

@araffin araffin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, but I guess we should deprecate --gym-packages, see #390 (package:env_id might already be working)

@turbotimon
Copy link
Author

turbotimon commented Apr 23, 2024

package:env_id is the first thing I tried, but unfortunately it does not work yet (v2.3.0)...

ENV_NAME = 'gym_environment:gym_environment/GridWorld-v0' # My custom environment

# Works
from gymnasium import make_vec
env = make_vec(ENV_NAME) 

# ValueError: gym_environment:gym_environment/GridWorld-v0 not found in gym registry ....
import sys
from rl_zoo3.train import train
sys.argv = ["python", "--algo", "ppo", "--env", ENV_NAME]
train() 

(You could try using this template for custom env)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants