LoginSignup
4
2

More than 5 years have passed since last update.

Windowsで強化学習フレームワークGoogle_Dopamineを使う

Last updated at Posted at 2018-10-22

WindowsでGoogle_Dopamineを使うまで。詰まったところとか、備忘録としてまとめる。

1.環境
・window8.1
・anaconda(-python3.5)

2.構築手順
(1)必要なものをインストールする(公式を参考に進める. https://github.com/google/dopamine)
$ pip install absl-py atari-py gin-config gym opencv-python tensorflow
image.png
atari-pyがビルドできなくてインストールエラー。
↓を入れて再トライ。

$conda install -y cmake
$conda install -y zlib

まだできない。

どうやらwindows用のatariがあるっぽい?

$pip install --no-index -f https://github.com/Kojoley/atari-py/releases atari_py

参考URL:https://stackoverflow.com/questions/42605769/openai-gym-atari-on-windows?rq=1
https://github.com/openai/atari-py
http://daruma3940.hatenablog.com/entry/2017/08/13/030344

無事インストールできたっぽい。

(2)動作を確認する
公式からダウンロード。

$git clone https://github.com/google/dopamine.git

これが動けばとりあえずインストールは成功しているらしいが,,,

$cd dopamine
$python tests/atari_init_test.py

エラーでました。No Such File or Directoryみたいなのが書いてある。
image.png

いろいろ調べてたら、
dopamine\tests\atari_init_test.pyのsetUpを以下のように変更。

atari_init_test.py
def setUp(self):
    FLAGS( [ '--gin_files' ] )
    FLAGS.gin_files = ['dopamine/agents/dqn/configs/dqn.gin']
    FLAGS.base_dir = os.path.join(
        'C:/workspace/git/dopamine/tmp/dopamine_tests',
         datetime.datetime.utcnow().strftime('hogehoge'))
    FLAGS.agent_name = 'dqn'
    # `num_iterations` set to zero to prevent runner execution.
    FLAGS.gin_bindings = [
        'Runner.num_iterations=0',
        'WrappedReplayBuffer.replay_capacity = 100'  # To prevent OOM.
    ]
    FLAGS.alsologtostderr = True

あと、フォルダへのアクセスエラーも出て他ので、\dopamine\tmp\dopamine_tests\hogehogeを追加して、
作業フォルダへのパスも追加したらできた。
参考URL:https://stackoverflow.com/questions/52086240/dopamine-memory-error-and-attribute-error-in-rainbow-agent-test-py
  https://github.com/google/dopamine/issues/13
  

4
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
2