Is it possible to get uint8 observations for Atari? #69
Answered
by
Trinkle23897
AdityaGudimella
asked this question in
Q&A
-
Hello, |
Beta Was this translation helpful? Give feedback.
Answered by
Trinkle23897
Apr 18, 2022
Replies: 1 comment 2 replies
-
It is uint8 already. In [1]: import envpool
In [2]: e=envpool.make_gym("Pong-v5")
In [3]: e.observation_space
Out[3]: Box(0, 255, (4, 84, 84), uint8)
In [4]: e.reset()
Out[4]:
array([[[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]],
[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]],
[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]],
[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]]]], dtype=uint8)
In [5]: import numpy as np
In [6]: e.step(np.array([0]))
Out[6]:
(array([[[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]],
[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]],
[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]],
[[ 52, 52, 52, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
[ 87, 87, 87, ..., 87, 87, 87],
...,
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236],
[236, 236, 236, ..., 236, 236, 236]]]], dtype=uint8),
array([0.], dtype=float32),
array([False]),
{'env_id': array([0], dtype=int32),
'players': {'env_id': array([0], dtype=int32)},
'lives': array([0], dtype=int32),
'reward': array([0.], dtype=float32),
'TimeLimit.truncated': array([False])}) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Trinkle23897
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It is uint8 already.