티스토리 뷰

Unity

Unity ML _ ai 학습 프로젝트

잉_민 2025. 7. 14. 04:04
728x90
반응형

 

 

https://youtu.be/XySIVXJp7qE

이 튜토리얼을 따라한다.

https://github.com/Unity-Technologies/ml-agents

 

GitHub - Unity-Technologies/ml-agents: The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enab

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement ...

github.com

unity ml agents 깃에서 주소복사

원하는 경로에서 

git clone https://github.com/Unity-Technologies/ml-agents.git

유니티 허브에서 2023.2 다운로드 경로
나는 이걸로 변경되었음!!!!!!1

https://unity.com/releases/editor/archive

 

다운로드 아카이브

다운로드 아카이브

unity.com

(add 해서 불러와보고 그 버전따라서 설치하는 것 추천)

파이썬 설치하고 경로설정

echo 'export PATH="/opt/miniconda3/bin:$PATH"' >> ~/.zshrc


source ~/.zshrc

나는 미니콘다라 이렇게

가상환경 만들기

conda create -n ml-agent-test python=3.10.12

 

가상환경 활성화

conda activate ml-agent-test

 

unity ml agent 다운받은 경로에서 패키지 설치

cd ml-agents

pip install -e ./ml-agents-envs
pip install -e ./ml-agents


#설치확인
mlagents-learn --help

설치 완.


샘플 프로젝트 진행

강제로 지정하지말고 얘가 원래 버전알려주면 그걸 깔아야 오류안남 !

 

그래서 6버전으로 켰음.

ex로 공학습있음. 씬켜보면 agent 에  behavlor parameters있음 

이게 강화학습시키는 코드임. !

 

학습시키려면 코드를 돌려야함

터미널에서

mlagents-learn config/ppo/3DBall.yaml --ryn-id=test3DBall

그리고 유니티에서 플레이버튼을 누르라함.

경로에 .onnx 학습된모델이 생김

이경로에 임포트하면 !

 


예제 만들어보기 1

https://youtu.be/5y3MD2QqV8E

 


자 이제 기본기는 익혔으니 응용버전. 내가 문제를 정의하고, 강화학습 환경을 구축해보자.

https://youtu.be/zv9coqYozW0

 

강화학습.

환경이 있고, 규칙(+,-)이있다. 에이전트는 점수를 얻기위해 발전한다.

 

이 사람은 *컨테이너 적재 문제를 ML 에이전트를 통해 시뮬레이션하고 알맞은 문제를설정.

 

728x90
반응형
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/10   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함
반응형