剛剛執行unity3D 的 mlagents-learn 遇到一個錯誤
(py9ML) D:\MYWORK\unityProjects\unity3d_ml_test\ml-agents-envs>mlagents-learn Traceback (most recent call last): File "C:\Python39\py9ML\Scripts\mlagents-learn-script.py", line 33, in <module> sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')()) File "C:\Python39\py9ML\Scripts\mlagents-learn-script.py", line 25, in importlib_load_entry_point return next(matches).load() File "C:\Python39\lib\importlib\metadata.py", line 77, in load module = import_module(match.group('module')) File "C:\Python39\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1030, in _gcd_import File "<frozen importlib._bootstrap>", line 1007, in _find_and_load File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 680, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 790, in exec_module File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents\mlagents\trainers\learn.py", line 2, in <module> from mlagents import torch_utils File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents\mlagents\torch_utils\__init__.py", line 1, in <module> from mlagents.torch_utils.torch import torch as torch # noqa File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents\mlagents\torch_utils\torch.py", line 6, in <module> from mlagents.trainers.settings import TorchSettings File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents\mlagents\trainers\settings.py", line 25, in <module> from mlagents.trainers.cli_utils import StoreConfigFile, DetectDefault, parser File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents\mlagents\trainers\cli_utils.py", line 5, in <module> from mlagents_envs.environment import UnityEnvironment File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents-envs\mlagents_envs\environment.py", line 12, in <module> from mlagents_envs.side_channel.side_channel import SideChannel File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents-envs\mlagents_envs\side_channel\__init__.py", line 5, in <module> from mlagents_envs.side_channel.default_training_analytics_side_channel import ( # noqa File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents-envs\mlagents_envs\side_channel\default_training_analytics_side_channel.py", line 7, in <module> from mlagents_envs.communicator_objects.training_analytics_pb2 import ( File "d:\mywork\unityprojects\unity3d_ml_test\ml-agents-envs\mlagents_envs\communicator_objects\training_analytics_pb2.py", line 35, in <module> _descriptor.FieldDescriptor( File "c:\python39\py9ml\lib\site-packages\google\protobuf\descriptor.py", line 561, in __new__ _message.Message._CheckCalledFromGeneratedFile() TypeError: Descriptors 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). More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
找到這篇文章
https://www.cnblogs.com/booturbo/p/16339195.html
文章中說使用較舊版本即可
pip3 install --upgrade protobuf==3.20.1
剛剛測試還真的可以
留言板
歡迎留下建議與分享!希望一起交流!感恩!