'OpenAI - CarRacing-v1 observations are just numpy arrays of 0s
import gym
from gym.spaces import Box
import numpy as np
from PIL import Image as im
env = gym.make('CarRacing-v1')
action_space = env.action_space
env.observation_space = Box(low=0, high=255, shape=(3,64,64), dtype=env.observation_space.dtype)
env.reset()
for i in range(3):
random_action = env.action_space.sample()
obs, reward, done, info = env.step(random_action)
obs = np.transpose(obs, (2,0,1))
im.fromarray(obs, mode='RGB').save(f'test_{i}.png')
So I have this code for setting up CarRacing-v1. For whatever reason obs is just coming out as a numpy array of shape (3, 96, 96) of all 0s. This is what should be coming out.
I was told this could be a rendering issue caused by not having pyglet, but I installed pyglet 1.3.2 and it's still just rendering nothing.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

