0

OpenAIGymを使い、強化学習をするコードを実行したところ、下記のようなエラーが出てしまいました。

Traceback (most recent call last):
  File "36_dqn_atari.py", line 121, in <module>
    dqn.fit(env, callbacks=callbacks,visualize=True, nb_steps=1750000, log_interval=10000)
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/rl/core.py", line 187, in fit
    callbacks.on_action_end(action)
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/rl/callbacks.py", line 101, in on_action_end
    callback.on_action_end(action, logs=logs)
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/rl/callbacks.py", line 366, in on_action_end
    self.env.render(mode='human')
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/gym/core.py", line 235, in render
    return self.env.render(mode, **kwargs)
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/gym/envs/atari/atari_env.py", line 152, in render
    from gym.envs.classic_control import rendering
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/gym/envs/classic_control/rendering.py", line 27, in <module>
    from pyglet.gl import *
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/pyglet/gl/__init__.py", line 95, in <module>
    from pyglet.gl.lib import GLException
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/pyglet/gl/lib.py", line 147, in <module>
    from pyglet.gl.lib_agl import link_GL, link_GLU, link_AGL
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/pyglet/gl/lib_agl.py", line 38, in <module>
    import pyglet.lib
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/pyglet/lib.py", line 55, in <module>
    script_path = pyglet.resource.get_script_home()
  File "/Users/xxxxx/Library/Python/2.7/lib/python/site-packages/pyglet/__init__.py", line 337, in __getattr__
    object.__setattr__(self, '_module', module)
TypeError: can't apply this __setattr__ to instance object

kerasのバージョンは2.3.1 tensorflowのバージョンは1.14.0です。
どなたかわかる方がいたら教えてください。

1 件の回答 1

2

https://github.com/pyglet/pyglet

Pyglet runs under Python 3.5+

とある通りPyglet はPython 2系をサポートしていません.Python2系はサポートがそろそろ切れることですし,理由がなければPython 3系を常用するようにしましょう.

この質問に回答するには、ログインする必要があります。