Getting “ AttributeError: 'ImageData' object has no attribute 'data' ” in headless gym jupyter Python 2.7
问题 I am trying to run gym in headless server and render the same in jupyter. Python version 2.7. I have started the jupyter using xvfb-run -a -s "-screen 0 1400x900x24" jupyter notebook Below is the Jupyte cell that I run. import matplotlib.pyplot as plt import gym from IPython import display %matplotlib inline env = gym.make('CartPole-v0') env.reset() plt.imshow(env.render(mode='rgb_array')) display.display(plt.gcf()) display.clear_output(wait=True) env.step(env.action_space.sample()) # take a