LoginSignup
0
0

Unity ML-Agent (Release20) 導入で詰まったところ

Last updated at Posted at 2023-08-13

概要

Unity ML-Agent (Release20)の導入に際して詰まった点をまとめておきます。
ML-Agentのインストールドキュメントを読めばインストールできるはずですが、私が試みたとき(2023/8/12)ではモジュールが配布されていない等の課題に突き当たりました。
備忘のため、インストール環境と起こった問題およびその対処法を残しておきます。
メモレベルなので必要があれば後で清書します。

環境(主要なライブラリのバージョン)

PCは、Surface notebbook2(GTX1050搭載モデル)
Windows 11(Pro バージョン 22H2)
Anaconda バージョン:conda 23.5.2
Python 3.8.17
cuda toollkit 11.8
Pytorch 2.0.1

起きたこと & 原因 & 対策

protobufのダウングレード

学習を実行させようとすると、「ディレクトリ作成できません」と言われる。
Anaconda Navigatorを使い、アンインストール→バージョン落としてインストール。
"
TypeError: cannot not be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:

  1. Downgrade the protobuf package to 3.20.x or lower.
  2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).
    "

onnxのインストール

学習を実行させようとすると、「ディレクトリ作成できません」と言われる。
インストールする。

"
Traceback (most recent call last):
File "C:\Users\headf\anaconda3\envs\mlagent\lib\site-packages\torch\onnx_internal\onnx_proto_utils.py", line 219, in _add_onnxscript_fn
import onnx
ModuleNotFoundError: No module named 'onnx'

"

Numpyのバージョン

初回は学習できたが、2回目学習させると。。
''
AttributeError: module 'numpy' has no attribute 'float'.
np.float was a deprecated alias for the builtin float. To avoid this error in existing code, use float by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.float64 here.
The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at:
https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
''

というエラーが出る。
Numpy 1.19.xにダウングレードする。

参考サイト

0
0
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
0
0