実現したいこと
Unity ML-Agentsを使った簡単な機械学習
前提
初めての機械学習で、何とかUnityロゴのアスキーアートをお目にかかれたところです。
しかし、Anaconda Promptでmlagents-learnコマンドを実行しても、Unity上で学習がスタートしません。
このサイトを見ながら進めています。現在つまずいている場所は、「5-2 訓練を実行する」です。Unityエディタに戻って、再生ボタンを押しても訓練が始まりまらず、しかし手動でボールを動かせる状態です。
resultsファイルは生成されていますが、モデル?は見当たりませんでした。
一応、今考えている原因として、単純にPCのスペックが足りてない可能性があります。
そこも含めて有識者の意見を聞きたいです。
初心者で常識知らずなところがありますが、欲しい補足情報などがあったら、質問してください。
発生している問題・エラーメッセージ
Anaconda Promptのエラーメッセージには、「Unity環境が応答するまでに時間がかかりすぎている」と言われています。
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' Behavior Parameters > Behavior Type is set to "Default" The environment and the Python interface have compatible versions. If you're running on a headless server without graphics support, turn off display by either passing --no-graphics option or build your Unity executable as server build.
Unityでは一回だけ下のようなエラーが発生しましたが、再起動したら出なくなりました。現在は一つもエラーは発生してません。
ArgumentNullException: Value cannot be null. Parameter name: _unity_self UnityEditor.SerializedObject.FindProperty (System.String propertyPath) (at <da771086bc2e4cfc9ad0a72e083a7f98>:0) UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindPropertyRelative (UnityEngine.UIElements.IBindable field, UnityEditor.SerializedProperty parentProperty) (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0) UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.BindTree (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0) UnityEditor.UIElements.Bindings.SerializedObjectBindingContext.ContinueBinding (UnityEngine.UIElements.VisualElement element, UnityEditor.SerializedProperty parentProperty) (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0) UnityEditor.UIElements.Bindings.DefaultSerializedObjectBindingImplementation+BindingRequest.Bind (UnityEngine.UIElements.VisualElement element) (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0) UnityEngine.UIElements.VisualTreeBindingsUpdater.Update () (at <e66f217a64a747d48b478f0d70978704>:0) UnityEngine.UIElements.VisualTreeUpdater.UpdateVisualTreePhase (UnityEngine.UIElements.VisualTreeUpdatePhase phase) (at <e66f217a64a747d48b478f0d70978704>:0) UnityEngine.UIElements.Panel.UpdateBindings () (at <e66f217a64a747d48b478f0d70978704>:0) UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.UpdateSchedulers () (at <e66f217a64a747d48b478f0d70978704>:0) UnityEngine.UIElements.UIEventRegistration.UpdateSchedulers () (at <e66f217a64a747d48b478f0d70978704>:0) UnityEditor.RetainedMode.UpdateSchedulers () (at <8ad9ecbe25e14b10b6dde783af6e4aa2>:0)
ソースコード
参考にしたサイトと全く同じです。(RollerAgent.csとRollerBall.yaml)
試したこと
RollerAgent の Inspector の Behavior Parameters 内の Behavior Type が Default なのは確認しました。
Chat-GPTにエラー文をコピペして聞いてみたんですが、あまり有力な回答は得られませんでした。
補足情報(FW/ツールのバージョンなど)
- 参考にしたサイト
[Unity]ML-Agentsを使うための環境構築(Release 12)
[Unity]ML-Agentsのサンプルゲームを動かしてみる(Release 12)
(このサイトのバージョンではうまくいかなかったので、UnityやML-Agentsは最新版を使っています。)
- PCのスペック
Surface Pro 9
Windows 11
CPU: 第 12 世代 Intel ® Core™ i5-1235U プロセッサ
GPU: Intel® Iris® Xe グラフィックス
- 各種バージョン
Unity 2022.3.4f1
ML-Agents Release20
python: 3.8.13
Anaconda: 23.5.0
numpy: 1.21.2
protobuf: 3.20.0
ml-agents: 0.30.0,
ml-agents-envs: 0.30.0,
Communicator API: 1.5.0,
PyTorch: 2.0.1+cpu

あなたの回答
tips
プレビュー