是否可以使用nvidia-docker版本1.0在Docker容器中运行OpenAI的健身房(更具体地说是car_racing)?我知道有必要使用xvfb-run来模拟显示以允许pyglet渲染,但是即使使用它,并针对我无法运行的不同cuda版本和ubuntu版本尝试不同的nvidia / cuda和nvidia / cudagl图像它。
我尝试了不同的操作,并且总是遇到相同的错误。我应该说,使其在nvidia-docker2上运行更容易。我使用过xvfb,类似xvfb-run -a -s "-screen 0 1400x900x24 python run_car_racing.py
,我还尝试过使用openai和stable-baselines(例如link)等不同的内置映像,但都在docker-nvidia v1中失败。
基本上,我在容器中启动CarRacing时总是遇到的错误
root/miniconda3/lib/python3.6/site-packages/numpy/core/fromnumeric.py:3118: RuntimeWarning: Mean of empty slice.
out=out, **kwargs)
/root/miniconda3/lib/python3.6/site-packages/numpy/core/_methods.py:85: RuntimeWarning: invalid value encountered in double_scalars
ret = ret.dtype.type(ret / rcount)
Process SpawnProcess-1:
Traceback (most recent call last):
File "/root/miniconda3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/root/miniconda3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/HRL/hrl/common/track_generator.py", line 17, in worker
env.reset()
File "/gym/gym/envs/box2d/car_racing.py", line 1543, in reset
obs = self.step(None)[0]
File "/gym/gym/envs/box2d/car_racing.py", line 1581, in step
self._update_state(self.render("state_pixels"))
File "/gym/gym/envs/box2d/car_racing.py", line 1609, in render
from gym.envs.classic_control import rendering
File "/gym/gym/envs/classic_control/rendering.py", line 23, in <module>
from pyglet.gl import *
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/__init__.py", line 239, in <module>
import pyglet.window
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/window/__init__.py", line 1896, in <module>
gl._create_shadow_window()
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/__init__.py", line 208, in _create_shadow_window
_shadow_window = Window(width=1, height=1, visible=False)
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/window/xlib/__init__.py", line 166, in __init__
super(XlibWindow, self).__init__(*args, **kwargs)
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/window/__init__.py", line 571, in __init__
self._create()
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/window/xlib/__init__.py", line 263, in _create
self.context.attach(self.canvas)
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 323, in attach
self.set_current()
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/xlib.py", line 328, in set_current
super(XlibContext13, self).set_current()
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/base.py", line 301, in set_current
gl_info.set_active_context()
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/gl_info.py", line 98, in set_active_context
if self.have_version(3):
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/gl_info.py", line 170, in have_version
imajor, iminor, irelease = [int(v) for v in ver.split('.', 3)[:3]]
File "/root/miniconda3/lib/python3.6/site-packages/pyglet/gl/gl_info.py", line 170, in <listcomp>
imajor, iminor, irelease = [int(v) for v in ver.split('.', 3)[:3]]
ValueError: invalid literal for int() with base 10: ''
任何想法如何使其运行?还是我做错了什么?我没有选择更新到nvidia-docker2
的选项