使用環境
anaconda3
python3.7(仮想環境)
stable-baselines[mpi]
windows10
環境構築
参考にした書籍:https://www.borndigital.co.jp/book/17130.html
①仮想環境の構築
conda create -n openai_gym python=3.7 anaconda
conda active openai_gym
pip install tensorflow==1.14.0
②stable-baselinesのインストール
pip install stable-baselines[mpi]
pip install --upgrade --user pyqtwebengine==5.12
pip isntall --upgrade --user pyqt5==5.12
pip isntall imageio
現在、強化学習の勉強をしておりAtariにある「breakout」の学習を行っているのですが、その際に以下ようなエラーが出てしまいます。なお、書籍のホームページからダウンロードできた「breakout.py」というソースコードを実行しました。
(openai_gym) C:\Users\kouse\OneDrive\デスクトップ\sample\5_Atari環境の攻略\1_Atari環境の学習>python breakout.py
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorflow\python\framework\dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorflow\python\framework\dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorflow\python\framework\dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorflow\python\framework\dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorflow\python\framework\dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorflow\python\framework\dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint8 = np.dtype([("qint8", np.int8, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint8 = np.dtype([("quint8", np.uint8, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_qint16 = np.dtype([("qint16", np.int16, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
_np_quint16 = np.dtype([("quint16", np.uint16, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_qint32 = np.dtype([("qint32", np.int32, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\tensorboard\compat\tensorflow_stub\dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.
np_resource = np.dtype([("resource", np.ubyte, 1)])
C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\stable_baselines_init.py:33: UserWarning: stable-baselines is in maintenance mode, please use Stable-Baselines3 (SB3) for an up-to-date version. You can find a migration guide in SB3 documentation.
"stable-baselines is in maintenance mode, please use Stable-Baselines3 (SB3) for an up-to-date version. You can find a migration guide in SB3 documentation."
WARNING:tensorflow:From C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\stable_baselines\common\misc_util.py:26: The name tf.set_random_seed is deprecated. Please use tf.compat.v1.set_random_seed instead.
Traceback (most recent call last):
File "breakout.py", line 64, in <module>
main()
File "breakout.py", line 27, in main
train_env = DummyVecEnv([make_env(ENV_ID, i) for i in range(NUM_ENV)])
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\stable_baselines\common\vec_env\dummy_vec_env.py", line 23, in init
self.envs = [fn() for fn in env_fns]
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\stable_baselines\common\vec_env\dummy_vec_env.py", line 23, in <listcomp>
self.envs = [fn() for fn in env_fns]
File "breakout.py", line 16, in init
env = gym.make(env_id)
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\gym\envs\registration.py", line 184, in make
return registry.make(id, **kwargs)
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\gym\envs\registration.py", line 106, in make
env = spec.make(**kwargs)
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\gym\envs\registration.py", line 75, in make
cls = load(self.entry_point)
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\gym\envs\registration.py", line 18, in load
mod = importlib.import_module(mod_name)
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\importlib_init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in call_with_frames_removed
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\gym\envs\atari_init.py", line 1, in <module>
from gym.envs.atari.atari_env import AtariEnv
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\gym\envs\atari\atari_env.py", line 9, in <module>
import atari_py
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\atari_py_init.py", line 1, in <module>
from .ale_python_interface import *
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\site-packages\atari_py\ale_python_interface.py", line 18, in <module>
'ale_interface/ale_c.dll'))
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\ctypes_init.py", line 442, in LoadLibrary
return self.dlltype(name)
File "C:\Users\kouse\anaconda3\envs\openai_gym\lib\ctypes_init.py", line 364, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 指定されたモジュールが見つかりません。
自分で調べたところ、何やら「dllファイル」というものが不足しているらしいということが分かったのですが、どのdllファイルが不足しているのか、また不足しているdllファイルの探し方が分かりません。ですので、不足しているdllファイルの探し方について教えていただきたいです。なお、stable-baselines自体は正常に動作していました。atariを実行しようとするとエラーが出てしまうといった状況です。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー