Closed sachinruk closed 5 years ago
So turns out what was happening was that I should have been saving a copy of observation, not just appending it. Observation was being constantly rewritten. This was my work around:
frames = np.zeros((MAX_STEPS, 240, 256, 3), dtype=np.uint8)
for step in range(MAX_STEPS):
# Render into buffer.
frames[step] = env.render(mode = 'rgb_array')
observation, reward, done, info = env.step(env.action_space.sample())
Describe the bug
I am trying to get a movie of my agent by plotting the observations. However, the observations do not change even though the rewards, and infos change.
Reproduction Script
Provide a script to reproduce the error using the following template, replacing
<YOUR SCRIPT>
with your script:Expected behavior
The mean (absolute) difference between any two frames is constantly zero. I would have expected the image to change when plotting. However, when looking at the
infos
array, thex_pos, y_pos
is constantly changing. This to me indicates that the plotting function is not working for some reason.Additional context
I am running this on google colab. I installed the library by simply doing
!pip install gym-super-mario-bros
.