can't close the render window
bionicles opened this issue · comments
bion howard commented
what's the correct way to close the render window after an episode?
tried:
env.close()
env.render(close=True)
del env
the examples just run in a standalone script which closes after it's done, but most folks would run this in a function in a loop, the window staying open clutters the screen
bion howard commented
got it working, albeit differently, like this:
import matplotlib.pyplot as plt
# ... before the episode:
if "procgen" in env_name:
plt.ion()
plt.show()
# ... during the loop:
if "procgen" in env_name:
plt.clf()
plt.imshow(info["rgb"])
plt.pause(1 / 144)
# ... after the episode:
if "procgen" in env_name:
plt.close()
other envs work like this, can we implement this api?
# ... during the loop:
env.render()
# ... after the episode:
env.close()
bion howard commented
My bad, just saw the gym3 design doc re: no render method. I figured it out so ill close this