我正在尝试使用这个工具包来掌握在模拟中创建机器学习代理的窍门。它似乎是最简单的一个,所以我遵循了一个叫做CodeMonkey的频道的教程。有人知道这里出了什么问题吗?(https://www.youtube.com/watchv=zPFU30tbyKs&ab_channel=CodeMonkey)。
'''
Traceback (most recent call last):
File "/usr/local/bin/mlagents-learn", line 5, in <module>
from mlagents.trainers.learn import main
File "/usr/local/lib/python3.9/site-packages/mlagents/trainers/learn.py", line 2, in <module>
from mlagents import torch_utils
File "/usr/local/lib/python3.9/site-packages/mlagents/torch_utils/__init__.py", line 1, in <module>
from mlagents.torch_utils.torch import torch as torch # noqa
File "/usr/local/lib/python3.9/site-packages/mlagents/torch_utils/torch.py", line 6, in <module>
from mlagents.trainers.settings import TorchSettings
File "/usr/local/lib/python3.9/site-packages/mlagents/trainers/settings.py", line 644, in <module>
class TrainerSettings(ExportableSettings):
File "/usr/local/lib/python3.9/site-packages/mlagents/trainers/settings.py", line 667, in TrainerSettings
cattr.register_structure_hook(
File "/usr/local/lib/python3.9/site-packages/cattr/converters.py", line 207, in register_structure_hook
self._structure_func.register_cls_list([(cl, func)])
File "/usr/local/lib/python3.9/site-packages/cattr/dispatch.py", line 55, in register_cls_list
self._single_dispatch.register(cls, handler)
File "/usr/local/Cellar/python@3.9/3.9.12/Frameworks/Python.framework/Versions/3.9/lib/python3.9/functools.py", line 855, in register
raise TypeError(
TypeError: Invalid first argument to `register()`. typing.Dict[mlagents.trainers.settings.RewardSignalType, mlagents.trainers.settings.RewardSignalSettings] is not a class.
'''
2条答案
按热度按时间8wtpewkr1#
正如user19218911提到的,Python 3.9不兼容,Python 3.10也不兼容。
安装Python 3.8,创建虚拟环境,并使用该版本的Python下载包。
luaexgnf2#
Python 3.9不兼容。不知道为什么。