Unity mlagents release 17을 사용하고 있습니다.
아래에 나오는 에러들은 mlagents-learn명령을 실행했을 때 나타난 오류들을 정리해둔 것입니다.
환경이나 버전에 따라 다른 오류들이 발생할 수도 있습니다.
anaconda에서 가상환경 설정하고
#mlagents 설치
pip install mlagents==0.26.0
잘 설치됐는지 확인
pip show mlagents
pip show mlagents-envs
아래 결과창이 나오면 성공
#파이썬 설치
conda install python=3.7
python을 3.7버전으로 설치해줍니다.
이렇게 설치하고 버전을 확인해봤는데 3.7.16 버전이 설치됐습니다. 3.7.x면 문제없이 작동하기에 그대로 사용해줍니다.
파이썬 버전이 다를 경우 아래 에러가 발생함. chatGPT에 물어봐도 파이썬 버전이 달라서 문제라는 말은 해주지 않음. 구글링해서 비슷하게 에러난 사람의 경우를 보고 따라했음.
chatGPT에 파이썬 버전이 다를 경우 나타날 수 있는 에러라는 질문을 하면 그렇다고 대답해줌.
TypeError: Invalid first argument to `register()`. typing.Dict[mlagents.trainers.settings.RewardSignalType, mlagents.trainers.settings.RewardSignalSettings] is not a class.
python 버전 확인
python #파이썬 인터프리터 실행
>>>import sys
>>>print(sys.version)
>>>exit() #파이썬 인터프리터 종료
AssertionError: A compatible version of PyTorch was not installed. Please visit the PyTorch homepage (https://pytorch.org/get-started/locally/) and follow the instructions to install. Version 1.6.0 and later are supported.
#파이토치 버전 호환 문제
보이는 것처럼 1.6.0버전 이상을 사용해야 한다.
#파이토치 업그레이드(최신버전)
pip install --upgrade torch
ModuleNotFoundError: No module named 'six'
#six모듈이 현재 파이썬 환경에 설치되어 있지 않음
#six 모듈 설치
pip install six
#mlagents학습 시작
mlagents-learn
아래 사진과 같이 결과 창이 나오면 mlagents는 정상적으로 작동하는 것입니다.
'Unity ML-Agent' 카테고리의 다른 글
[해결]AttributeError: 'str' object has no attribute '_key' (0) | 2023.11.03 |
---|---|
[미해결/mlagents yaml] (0) | 2023.11.03 |