udacity / dlnd-issue-reports

5 stars 0 forks source link

RL discretisation notebooks crash #586

Open jetojedno opened 6 years ago

jetojedno commented 6 years ago

The reinforcement learning discretisation notebooks crash if being run using jupyter notebooks on remote server.

jetojedno commented 6 years ago

The solution for me (example for Discretization.ipynb):

add: from IPython import display near top

change code box to: img = plt.imshow(env.render(mode='rgb_array'))

state = env.reset() score = 0 for t in range(200): action = env.action_space.sample() img.set_data(env.render(mode='rgb_array')) display.display(plt.gcf()) display.clearoutput(wait=True) state, reward, done, = env.step(action) score += reward if done: break print('Final score:', score) env.close()