You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on the CarRacing-v0 environment. When the environment first launches, it seems fine, and consumes about 800MB of memory. But after a few runs, it starts consuming way too much memory and eventually crashes with pyglet throwing an error saying that the _length attribute is too large.
Here is the traceback:
Traceback (most recent call last):
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\pyglet\graphics\vertexdomain.py", line 241, in _safe_alloc
return self.allocator.alloc(count)
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\pyglet\graphics\allocation.py", line 194, in alloc
raise AllocatorMemoryException(self.capacity + size - free_size)
pyglet.graphics.allocation.AllocatorMemoryException: 67109696
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "test.py", line 53, in <module>
env.render()
File "E:\Google Drive\Acads\Junior year\Semester 5\Project Course\Gym\CarRacingv0-PPO-pytorch\environment.py", line 59, in render
self.env.render(*arg)
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\gym\core.py", line 240, in render
return self.env.render(mode, **kwargs)
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\gym\envs\box2d\car_racing.py", line 460, in render
self.render_road()
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\gym\envs\box2d\car_racing.py", line 529, in render_road
len(polygons_) // 3, ("v3f", polygons_), ("c4f", colors) # gl.GL_QUADS,
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\pyglet\graphics\__init__.py", line 287, in vertex_list
return _get_default_batch().add(count, 0, None, *data)
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\pyglet\graphics\__init__.py", line 368, in add
vlist = domain.create(count)
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\pyglet\graphics\vertexdomain.py", line 271, in create
start = self._safe_alloc(count)
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\pyglet\graphics\vertexdomain.py", line 246, in _safe_alloc
buffer.resize(capacity * buffer.element_size)
File "C:\Users\pveen\AppData\Local\Programs\Python\Python36\lib\site-packages\pyglet\graphics\vertexbuffer.py", line 427, in resize
data = (ctypes.c_byte * size)()
OverflowError: The '_length_' attribute is too large
Any hints as to how to solve this would be really helpful. As of now, I am simply catching the exception, and deleting the environment variable and reinitializing it inside a loop to continue training, which is not really a fix :/
The text was updated successfully, but these errors were encountered:
praveenVnktsh
changed the title
CarRacing-v0: The _length attribute is too large
CarRacing-v0 - Potential Memory Leak: The _length attribute is too large
Nov 15, 2020
Hi!
I was working on the CarRacing-v0 environment. When the environment first launches, it seems fine, and consumes about 800MB of memory. But after a few runs, it starts consuming way too much memory and eventually crashes with pyglet throwing an error saying that the _length attribute is too large.
Here is the traceback:
Any hints as to how to solve this would be really helpful. As of now, I am simply catching the exception, and deleting the environment variable and reinitializing it inside a loop to continue training, which is not really a fix :/
The text was updated successfully, but these errors were encountered: