openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.54k stars 8.59k forks source link

`python': free(): invalid pointer: Aborted (core dumped) Making new env: CartPole-v0 #567

Closed NataliaDiaz closed 7 years ago

NataliaDiaz commented 7 years ago

Hi, I get free(): invalid pointer error running both the notebook and reinforcement_q_learning.py of pyTorch tutorials (the kernels dies and restarts, but seems a gym issue (see here):

~/notebooks$ jupyter notebook [I 09:22:24.158 NotebookApp] Serving notebooks from local directory: /home/natalia/notebooks [I 09:22:24.158 NotebookApp] 0 active kernels [I 09:22:24.158 NotebookApp] The Jupyter Notebook is running at: http://localhost:8888/?token=e70854c1d5423883eda6325c1b503efbebafff06ad9e0177 [I 09:22:24.158 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). [C 09:22:24.160 NotebookApp] Copy/paste this URL into your browser when you connect for the first time, to login with a token: http://localhost:8888/?token=e70854c1d5423883eda6325c1b503efbebafff06ad9e0177 Created new window in existing browser session. [I 09:22:24.727 NotebookApp] Accepting one-time-token-authenticated connection from 127.0.0.1 [I 09:22:28.993 NotebookApp] Kernel started: 7f72071a-3b5a-4f39-86f0-d59cdc01aaee [W 09:22:29.307 NotebookApp] 404 GET /static/components/MathJax/jax/element/mml/optable/BasicLatin.js?rev=2.6.0 (127.0.0.1) 8.88ms referer=http://localhost:8888/notebooks/reinforcement_q_learning.ipynb [W 09:22:35.066 NotebookApp] Notebook face_recognition.ipynb is not trusted [I 09:22:35.437 NotebookApp] Kernel started: 896f0bbe-e196-4047-b2c1-2736eef40679 *** Error in `/home/natalia/anaconda2/bin/python': free(): invalid pointer: 0x00007fa045d28ae0 *** [I 09:22:37.993 NotebookApp] KernelRestarter: restarting kernel (1/5) WARNING:root:kernel 7f72071a-3b5a-4f39-86f0-d59cdc01aaee restarted [I 09:23:29.670 NotebookApp] 302 GET /?token=e70854c1d5423883eda6325c1b503efbebafff06ad9e0177 (127.0.0.1) 0.39ms [W 09:23:33.148 NotebookApp] 404 GET /static/components/MathJax/jax/element/mml/optable/BasicLatin.js?rev=2.6.0 (127.0.0.1) 1.59ms referer=http://localhost:8888/notebooks/reinforcement_q_learning.ipynb *** Error in `/home/natalia/anaconda2/bin/python': free(): invalid pointer: 0x00007f6a5a17dae0 *** [I 09:23:40.999 NotebookApp] KernelRestarter: restarting kernel (1/5) WARNING:root:kernel 7f72071a-3b5a-4f39-86f0-d59cdc01aaee restarted

~/notebooks$ python reinforcement_q_learning.py [2017-04-18 09:24:11,190] Making new env: CartPole-v0 Error in `python': free(): invalid pointer: 0x00007f83611bbae0 Aborted (core dumped)

This is in Ubuntu 14.04 using Python 2.7.

tlbtlbtlb commented 7 years ago

I suspect the problem is that you don't have a working X11/OpenGL server. The tutorial code calls env.render(mode='rgb_array'), which imports pyglet.gl to render an image of the cart into a pixel array. Pyglet doesn't handle missing X11 servers very well.

You might be able to reproduce the crash with:

import pyglet
w=pyglet.window.Window(640, 480)
w.clear()
w.switch_to()
w.dispatch_events()

If you're not running this on a Linux box with a real X11 server, you can run Xdummy