Closed tv76 closed 3 years ago
Facing the same issue here. If anyone has a workaround, please suggest.
!apt install xvfb -y !pip install pyvirtualdisplay !pip install piglet
from pyvirtualdisplay import Display display = Display(visible=0, size=(1400, 900)) display.start()
using pyvirtualdisplay fixed it for me.
Turn on the GPU in Colab.
I am facing the same problem while trying to run the colab notebook in the tutorial: https://colab.research.google.com/github/pytorch/tutorials/blob/gh-pages/_downloads/2b3f06b04b5e96e4772746c20fcb4dcc/reinforcement_q_learning.ipynb Non of the solutions here seemed to be working
Periodically I try to run the example (my computer: Windows 10, browser: Google Chrome):
pytorch.org -> Tutorials -> Reinforcement Learning -> Reinforcement Learning (DQN) Tutorial -> Run in Google Colab -> menu Runtime -> menu item Run All.
But I always get such error: NoSuchDisplayException Traceback (most recent call last) in () 39 env.reset() 40 plt.figure() —> 41 plt.imshow(get_screen().cpu().squeeze(0).permute(1, 2, 0).numpy(), 42 interpolation=‘none’) 43 plt.title(‘Example extracted screen’)
9 frames /usr/local/lib/python3.6/dist-packages/pyglet/canvas/xlib.py in init(self, name, x_screen) 121 self._display = xlib.XOpenDisplay(name) 122 if not self._display: –> 123 raise NoSuchDisplayException(‘Cannot connect to “%s”’ % name) 124 125 screen_count = xlib.XScreenCount(self._display)
NoSuchDisplayException: Cannot connect to “None”