NM512 / dreamerv3-torch

Implementation of Dreamer v3 in pytorch.
MIT License
422 stars 96 forks source link

'None' type has no attribute "glGetError" #57

Closed Arnie-He closed 1 month ago

Arnie-He commented 5 months ago

I just cloned the repo and installed the dependencies in requirements.txt. However, whenever I run the dm-control example I get

_error_checker = _ErrorChecker( _p, _p.GL.glGetError ) AttributeError: 'NoneType' object has no attribute 'glGetError'

I tried to just make _error_checker 'None'. However in that case, I received all kinds of weird errors including this one:

python3 dreamer.py --configs dmc_vision --task dmc_walker_walk --logdir ./logdir/dmc_walker_walk Logdir logdir/dmc_walker_walk Create envs. Could not load episode: Object arrays cannot be loaded when allow_pickle=False Could not load episode: Object arrays cannot be loaded when allow_pickle=False Could not load episode: Object arrays cannot be loaded when allow_pickle=False Could not load episode: Object arrays cannot be loaded when allow_pickle=False /home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/gym/logger.py:34: UserWarning: WARN: Box bound precision lowered by casting to float32 warnings.warn(colorize("%s: %s" % ("WARN", msg % args), "yellow")) Action Space Box([-1. -1. -1. -1. -1. -1.], [1. 1. 1. 1. 1. 1.], (6,), float32) Prefill dataset (500 steps). Traceback (most recent call last): File "/home/arnie/Documents/dreamerv3-torch/dreamer.py", line 369, in main(parser.parse_args(remaining)) File "/home/arnie/Documents/dreamerv3-torch/dreamer.py", line 274, in main state = tools.simulate( File "/home/arnie/Documents/dreamerv3-torch/tools.py", line 155, in simulate results = [r() for r in results] File "/home/arnie/Documents/dreamerv3-torch/tools.py", line 155, in results = [r() for r in results] File "/home/arnie/Documents/dreamerv3-torch/parallel.py", line 209, in return lambda: self._env.reset() File "/home/arnie/Documents/dreamerv3-torch/envs/wrappers.py", line 117, in reset return self.env.reset() File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/gym/core.py", line 251, in reset return self.env.reset(kwargs) File "/home/arnie/Documents/dreamerv3-torch/envs/wrappers.py", line 26, in reset return self.env.reset() File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/gym/core.py", line 251, in reset return self.env.reset(kwargs) File "/home/arnie/Documents/dreamerv3-torch/envs/dmc.py", line 69, in reset obs["image"] = self.render() File "/home/arnie/Documents/dreamerv3-torch/envs/dmc.py", line 77, in render return self._env.physics.render(self._size, camera_id=self._camera) File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/mujoco/engine.py", line 216, in render camera = Camera( File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/mujoco/engine.py", line 695, in init if self._physics.contexts.mujoco is not None: File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/mujoco/engine.py", line 526, in contexts self._make_rendering_contexts() File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/mujoco/engine.py", line 509, in _make_rendering_contexts render_context = _render.Renderer( File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/base.py", line 63, in init ctx.call(self._platform_init, max_width, max_height) File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/executor/render_executor.py", line 196, in call return self._call_locked(func, args, kwargs) File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/executor/render_executor.py", line 206, in _call_locked return self._executor.submit(func, *args, *kwargs).result() File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/concurrent/futures/_base.py", line 440, in result return self.get_result() File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/concurrent/futures/_base.py", line 389, in get_result raise self._exception File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(self.args, self.kwargs) File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/pyopengl/osmesa_renderer.py", line 49, in _platform_init self._context = osmesa.OSMesaCreateContextExt( File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/OpenGL/platform/baseplatform.py", line 423, in call raise error.NullFunctionError( OpenGL.error.NullFunctionError: Attempt to call an undefined function OSMesaCreateContextExt, check for bool(OSMesaCreateContextExt) before calling Error in atexit._run_exitfuncs: Traceback (most recent call last): File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/executor/render_executor.py", line 214, in terminate self._call_locked(cleanup_callable) File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/executor/render_executor.py", line 206, in _call_locked return self._executor.submit(func, *args, **kwargs).result() File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/concurrent/futures/thread.py", line 161, in submit raise RuntimeError('cannot schedule new futures after shutdown') RuntimeError: cannot schedule new futures after shutdown Exception ignored in: <function ContextBase.del at 0x7f3707be45e0> Traceback (most recent call last): File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/base.py", line 118, in del File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/base.py", line 115, in _free_unconditionally File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/executor/render_executor.py", line 214, in terminate File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/executor/render_executor.py", line 206, in _call_locked File "/home/arnie/miniconda3/envs/dreamerv3-torch/lib/python3.9/concurrent/futures/thread.py", line 161, in submit RuntimeError: cannot schedule new futures after shutdown

I'm sure that my packages have the same version as requirements.txt asked. Could you help on understanding this problem?

Jeong-zju commented 5 months ago

I exactly have the same problem. I run the command python3 dreamer.py --configs dmc_vision --task dmc_walker_walk --logdir ./logdir/dmc_walker_walk. Here is the output: Logdir logdir/dmc_walker_walk Create envs. Traceback (most recent call last): File "/home/jeong/dreamerv3-torch/dreamer.py", line 365, in main(parser.parse_args(remaining)) File "/home/jeong/dreamerv3-torch/dreamer.py", line 238, in main train_envs = [make("train", i) for i in range(config.envs)] File "/home/jeong/dreamerv3-torch/dreamer.py", line 238, in train_envs = [make("train", i) for i in range(config.envs)] File "/home/jeong/dreamerv3-torch/dreamer.py", line 237, in make = lambda mode, id: make_env(config, mode, id) File "/home/jeong/dreamerv3-torch/dreamer.py", line 151, in make_env env = dmc.DeepMindControl( File "/home/jeong/dreamerv3-torch/envs/dmc.py", line 13, in init from dm_control import suite File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/suite/init.py", line 24, in from dm_control.suite import acrobot File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/suite/acrobot.py", line 20, in from dm_control import mujoco File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/mujoco/init.py", line 18, in from dm_control.mujoco.engine import action_spec File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/mujoco/engine.py", line 41, in from dm_control import _render File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/init.py", line 86, in Renderer = import_func() File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/init.py", line 46, in _import_osmesa from dm_control._render.pyopengl.osmesa_renderer import OSMesaContext File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/dm_control/_render/pyopengl/osmesa_renderer.py", line 35, in from OpenGL import GL File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/OpenGL/GL/init.py", line 4, in from OpenGL.GL.VERSION.GL_1_1 import File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/OpenGL/GL/VERSION/GL_1_1.py", line 14, in from OpenGL.raw.GL.VERSION.GL_1_1 import File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/OpenGL/raw/GL/VERSION/GL_1_1.py", line 7, in from OpenGL.raw.GL import _errors File "/home/jeong/miniconda3/envs/dreamerv3-torch/lib/python3.9/site-packages/OpenGL/raw/GL/_errors.py", line 4, in _error_checker = _ErrorChecker( _p, _p.GL.glGetError ) AttributeError: 'NoneType' object has no attribute 'glGetError'

maybeluo commented 2 months ago

I got the same error and this works for me link:

apt-get update && apt-get install ffmpeg libsm6 libxext6  -y
apt-get install -y libgl1-mesa-dev libosmesa6-dev