gpt4 book ai didi

python - pyglet尝试在docker容器中运行openai Gym时没有标准配置可用

转载 作者:行者123 更新时间:2023-12-02 18:30:12 26 4
gpt4 key购买 nike

通过遵循video中的说明,我能够从带有docker容器的GUI中获取GUI。 (通过尝试启动Firefox进行测试)

我已经安装了OpenAI体育馆。

尝试运行如here所示的示例代码时,出现以下错误

libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Traceback (most recent call last):
File "<stdin>", line 2, in <module>
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 153, in render
return self._render(mode=mode, close=close)
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 285, in _render
return self.env.render(mode, close)
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/core.py", line 153, in render
return self._render(mode=mode, close=close)
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/envs/classic_control/cartpole.py", line 114, in _render
from gym.envs.classic_control import rendering
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/gym/envs/classic_control/rendering.py", line 23, in <module>
from pyglet.gl import *
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/gl/__init__.py", line 239, in <module>
import pyglet.window
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/__init__.py", line 1896, in <module>
gl._create_shadow_window()
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/gl/__init__.py", line 208, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/xlib/__init__.py", line 166, in __init__
super(XlibWindow, self).__init__(*args, **kwargs)
File "/root/miniconda3/envs/reinforcement-learning/lib/python3.5/site-packages/pyglet/window/__init__.py", line 517, in __init__
raise NoSuchConfigException('No standard config is available.')
pyglet.window.NoSuchConfigException: No standard config is available.

最佳答案

如果在安装NVIDIA GPU驱动程序时未选择退出opengl库(例如,为.run文件指定-no-opengl-files选项),则可能是问题所在。我有一台没有安装这些lib的笔记本电脑,并且从包含健身房环境的镜像中获取了该容器,然后开始工作。但是,在装有nvidia驱动程序以及opengl lib的PC上,上述相同的镜像无法正常工作,并生成了pyglet.window.NoSuchConfigException
PS:我已经通过python3控制台在PC上进行了测试,发现可以在容器外部使用pyglet手动创建Window。

关于python - pyglet尝试在docker容器中运行openai Gym时没有标准配置可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49121200/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com