Unityとml-agentsを用いて機械学習したい
どのように環境構築を設定したら、Unityで学習ができるのでしょうか?
発生している問題・エラーメッセージ
mlagents-learn ./config/trainer_config.yaml --run-id=~~~と入力
2020-05-28 19:37:39.944015: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2020-05-28 19:37:39.948579: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. WARNING:tensorflow:From D:\Anaconda\envs\ml-agents\lib\site-packages\tensorflow\python\compat\v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term ▄▄▄▓▓▓▓ ╓▓▓▓▓▓▓█▓▓▓▓▓ ,▄▄▄m▀▀▀' ,▓▓▓▀▓▓▄ ▓▓▓ ▓▓▌ ▄▓▓▓▀' ▄▓▓▀ ▓▓▓ ▄▄ ▄▄ ,▄▄ ▄▄▄▄ ,▄▄ ▄▓▓▌▄ ▄▄▄ ,▄▄ ▄▓▓▓▀ ▄▓▓▀ ▐▓▓▌ ▓▓▌ ▐▓▓ ▐▓▓▓▀▀▀▓▓▌ ▓▓▓ ▀▓▓▌▀ ^▓▓▌ ╒▓▓▌ ▄▓▓▓▓▓▄▄▄▄▄▄▄▄▓▓▓ ▓▀ ▓▓▌ ▐▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▌ ▐▓▓▄ ▓▓▌ ▀▓▓▓▓▀▀▀▀▀▀▀▀▀▀▓▓▄ ▓▓ ▓▓▌ ▐▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▌ ▐▓▓▐▓▓ ^█▓▓▓ ▀▓▓▄ ▐▓▓▌ ▓▓▓▓▄▓▓▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▓▄ ▓▓▓▓` '▀▓▓▓▄ ^▓▓▓ ▓▓▓ └▀▀▀▀ ▀▀ ^▀▀ `▀▀ `▀▀ '▀▀ ▐▓▓▌ ▀▀▀▀▓▄▄▄ ▓▓▓▓▓▓, ▓▓▓▓▀ `▀█▓▓▓▓▓▓▓▓▓▌ ¬`▀▀▀█▓ Version information: ml-agents: 0.16.0, ml-agents-envs: 0.16.0, Communicator API: 1.0.0, TensorFlow: 2.2.0 2020-05-28 19:37:41.755400: W tensorflow/stream_executor/platform/default/dso_loader.cc:55] Could not load dynamic library 'cudart64_101.dll'; dlerror: cudart64_101.dll not found 2020-05-28 19:37:41.760354: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. WARNING:tensorflow:From D:\Anaconda\envs\ml-agents\lib\site-packages\tensorflow\python\compat\v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version. Instructions for updating: non-resource variables are not supported in the long term 2020-05-28 19:37:43 INFO [environment.py:201] Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
Unity上でPlayボタンを押す(接続できなかったためモデルを実行?と表示される)
Couldn't connect to trainer on port 5004 using API version 1.0.0. Will perform inference instead. UnityEngine.Debug:Log(Object) Unity.MLAgents.Academy:InitializeEnvironment() (at C:/Users/kator/OneDrive/ドキュメント/ml-agents-release_1/ml-agents-release_1/com.unity.ml-agents/Runtime/Academy.cs:394) Unity.MLAgents.Academy:LazyInitialize() (at C:/Users/kator/OneDrive/ドキュメント/ml-agents-release_1/ml-agents-release_1/com.unity.ml-agents/Runtime/Academy.cs:218) Unity.MLAgents.Academy:.ctor() (at C:/Users/kator/OneDrive/ドキュメント/ml-agents-release_1/ml-agents-release_1/com.unity.ml-agents/Runtime/Academy.cs:206) Unity.MLAgents.<>c:<.cctor>b__80_0() (at C:/Users/kator/OneDrive/ドキュメント/ml-agents-release_1/ml-agents-release_1/com.unity.ml-agents/Runtime/Academy.cs:78) System.Lazy`1:get_Value() Unity.MLAgents.Academy:get_Instance() (at C:/Users/kator/OneDrive/ドキュメント/ml-agents-release_1/ml-agents-release_1/com.unity.ml-agents/Runtime/Academy.cs:93) Unity.MLAgents.DecisionRequester:Awake() (at C:/Users/kator/OneDrive/ドキュメント/ml-agents-release_1/ml-agents-release_1/com.unity.ml-agents/Runtime/DecisionRequester.cs:49)
anaconda promptではタイムアウトとして以下のメッセージが出る。
2020-05-28 19:38:43 INFO [subprocess_env_manager.py:191] UnityEnvironment worker 0: environment stopping. Traceback (most recent call last): File "D:\Anaconda\envs\ml-agents\Scripts\mlagents-learn-script.py", line 11, in <module> load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')() File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\learn.py", line 554, in main run_cli(parse_command_line()) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\learn.py", line 550, in run_cli run_training(run_seed, options) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\learn.py", line 407, in run_training tc.start_learning(env_manager) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents-envs\mlagents_envs\timers.py", line 305, in wrapped return func(*args, **kwargs) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\trainer_controller.py", line 223, in start_learning self._reset_env(env_manager) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents-envs\mlagents_envs\timers.py", line 305, in wrapped return func(*args, **kwargs) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\trainer_controller.py", line 154, in _reset_env env.reset(config=sampled_reset_param) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\env_manager.py", line 67, in reset self.first_step_infos = self._reset_env(config) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\subprocess_env_manager.py", line 295, in _reset_env ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {}) File "c:\users\kator\onedrive\ドキュメント\ml-agents-release_1\ml-agents-release_1\ml-agents\mlagents\trainers\subprocess_env_manager.py", line 92, in recv raise env_exception mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that : The environment does not need user interaction to launch The Agents are linked to the appropriate Brains The environment and the Python interface have compatible versions.
該当のソースコード
サンプルの3dballを動かしているので省略
試したこと
仮想環境の作り直し
https://note.com/npaka/n/n167b2d03a347?magazine_key=m50f437a3f5e1#gqC2O を参考に導入
公式ドキュメントの参照(英語で難しかったです)
補足情報
ml-agents release1
その他
バージョンが更新されるたびに内容が大きく変わっているため、情報が私の頭の中で錯乱し訳が分からなくなりました。優しく教えていただけると嬉しいです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。