2

keras の RL 問題を解決するために DQN を実装しようとしています。私は MAC を使用し、Anaconda Jupyter 環境でこのコードを実行しています。このエラーを検索してみましたが、結果が得られませんでした。コード

from rl.agents.dqn import DQNAgent
from rl.policy import EpsGreedyQPolicy
from rl.memory import SequentialMemory

エラー

ImportError                               Traceback (most recent call last)
<ipython-input-31-7ffd4e2f21c3> in <module>
----> 1 from rl.agents.dqn import DQNAgent
  2 from rl.policy import EpsGreedyQPolicy
  3 from rl.memory import SequentialMemory

 /anaconda3/lib/python3.7/site-packages/rl/agents/__init__.py in <module>
  1 from __future__ import absolute_import
  ----> 2 from .dqn import DQNAgent, NAFAgent, ContinuousDQNAgent
  3 from .ddpg import DDPGAgent
  4 from .cem import CEMAgent
  5 from .sarsa import SarsaAgent, SARSAAgent

  /anaconda3/lib/python3.7/site-packages/rl/agents/dqn.py in <module>
  6 from keras.layers import Lambda, Input, Layer, Dense
  7 
   ----> 8 from rl.core import Agent
  9 from rl.policy import EpsGreedyQPolicy, GreedyQPolicy
 10 from rl.util import *

  /anaconda3/lib/python3.7/site-packages/rl/core.py in <module>
  6 from keras.callbacks import History
  7 
  ----> 8 from rl.callbacks import (
  9     CallbackList,
 10     TestLogger,

 /anaconda3/lib/python3.7/site-packages/rl/callbacks.py in <module>
  9 
 10 from keras import __version__ as KERAS_VERSION
 ---> 11 from keras.callbacks import Callback as KerasCallback, CallbackList as 
 KerasCallbackList
 12 from keras.utils.generic_utils import Progbar
 13 

 ImportError: cannot import name 'CallbackList' from 'keras.callbacks' 
 (/anaconda3/lib/python3.7/site-packages/keras/callbacks.py)
4

0 に答える 0