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

Observation and Action Spaces Violated #1278

Closed
jar577 opened this issue Jan 6, 2019 · 2 comments
Closed

Observation and Action Spaces Violated #1278

jar577 opened this issue Jan 6, 2019 · 2 comments

Comments

@jar577
Copy link

jar577 commented Jan 6, 2019

Hello, I setup a custom environment with my observation and action spaces as such:
high = np.array([1.5, 1.5, 1.5,1.5])
action_space = spaces.Box(low=np.array([0,0]), high=np.array([0.05,2*np.pi]), dtype=np.float32)
observation_space = spaces.Box(low=-high, high=high, dtype=np.float32)

However, when using my environment with PPO2, it seems to be willingly violating these. I tried debugging the script and stopped it within model.py and policies.py but the values remain unchanged. At line 52 of policies,py, though, the sampled action violates the provided space.

Can anyone assist me in figuring out what's going on? Just let me know if you need anything else. Thanks!

@jar577
Copy link
Author

jar577 commented Jan 7, 2019

I just now found this discussion: openai/baselines#121

Is the solution posed by joellutz the best way to go, or should I simply clip the action that is fed into my environment?

@christopherhesse
Copy link
Contributor

joellutz's solution looks like it is for ddpg, so it might not work with ppo2. If it doesn't, a clipping wrapper on the environment as proposed by olegklimov may be a good solution.

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

No branches or pull requests

2 participants