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

[Question] state dimension different from original gym. #137

Closed
hskAlena opened this issue Jul 21, 2021 · 2 comments
Closed

[Question] state dimension different from original gym. #137

hskAlena opened this issue Jul 21, 2021 · 2 comments
Labels
question Further information is requested

Comments

@hskAlena
Copy link

hskAlena commented Jul 21, 2021

In the gym FetchPush-v1, env.observation_space['observation'] outputs
Box(-inf, inf, (25,), float32)

However, when I print out 'observation' space length using enjoy.py,
it prints out 26.
`python enjoy.py --algo tqc --env FetchPush-v1

print(len(obs['observation'][0]))`

What makes the difference?
I'm using the agent's state output of enjoy.py, so the dimension should be the same.
Is this a bug or do I need to post-process the output before using it somewhere else?

System Info
Python version is 3.7.9
PyTorch version is 1.7.1

@araffin araffin added duplicate This issue or pull request already exists question Further information is requested and removed duplicate This issue or pull request already exists labels Jul 21, 2021
@araffin
Copy link
Member

araffin commented Jul 21, 2021

Hello,
if you take a look at TQC hyperparameters, it uses a time feature wrapper (see araffin/rl-baselines-zoo#79 and https://sb3-contrib.readthedocs.io/en/master/common/wrappers.html#timefeaturewrapper) which therefore adds an additional dimension to the input.
The enjoy.py script loads automatically the required wrappers.

@hskAlena
Copy link
Author

Hello!
I didn't know there were similar questions previously, thanks for your kind reply! :)
I guess I can just get rid of the last dimension of state space then, like obs['observation'][0][:-1]

Again, thanks a lot!

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

No branches or pull requests

2 participants