Record/TIL

[Unity] ML-Agent 버전 맞추기 (Window)

석영 2024. 7. 29. 22:11
반응형

이거 세팅해두는게 사실 젤 눈물납니다.

그래픽 카드 있는데도 CPU 버전으로 하시는분들 계시죠? 그러지맙시다..

CPU 터질라해요!!

 

 

버전 정리

GPU RTX3060
Unity 2022.3.17f1
ML-Agents 릴리스 19
Conda  
Python 3.8
Cuda 11.3
Torch 1.10.0+cu113
onnx 1.16.1
numpy 1.19.5
protobuf 3.20.2

 

크게 필요했던거 정리해뒀습니다.

!! Cuda는 본인 GPU에 맞는거 설치하셔야해요..

 

 

Unity

2022.3.17f1 LTS 버전 

>> Archive

 

다운로드 아카이브

다운로드 아카이브

unity.com

 

ML-Agents

릴리스 19 버전

>> GitHub

 

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

 

Conda

가상환경 구성 // 여기서 파이썬 3.8버전 설치

>> 공식 홈페이지

 

Download Now | Anaconda

Anaconda is the birthplace of Python data science. We are a movement of data scientists, data-driven enterprises, and open source communities.

www.anaconda.com

conda create -n test python=3.8
conda activate test

 

CUDA

11.3

>> 공식 홈페이지

 

CUDA Toolkit 11.3 Downloads

Get CUDA Toolkit 11.3 for Linux and Windows.

developer.nvidia.com

pip install torch==1.10.0+cu113 torchvision==0.11.1+cu113 torchaudio===0.10.0+cu113 -f https://download.pytorch.org/whl/torch_stable.html

 

전체 버전
(test) C:\Users\user\ml-agents-release_19>conda list
# packages in environment at C:\Users\user\anaconda3\envs\test:
#
# Name                    Version                   Build  Channel
absl-py                   2.1.0                    pypi_0    pypi
attrs                     23.2.0                   pypi_0    pypi
blas                      1.0                         mkl
brotli-python             1.0.9            py38hd77b12b_8
ca-certificates           2024.7.2             haa95532_0
cachetools                5.4.0                    pypi_0    pypi
cattrs                    1.5.0                    pypi_0    pypi
certifi                   2024.7.4         py38haa95532_0
charset-normalizer        3.3.2              pyhd3eb1b0_0
cloudpickle               3.0.0                    pypi_0    pypi
cuda-cccl                 12.4.127                      0    nvidia
cuda-cudart               12.4.127                      0    nvidia
cuda-cudart-dev           12.4.127                      0    nvidia
cuda-cupti                12.4.127                      0    nvidia
cuda-libraries            12.4.0                        0    nvidia
cuda-libraries-dev        12.4.0                        0    nvidia
cuda-nvrtc                12.4.127                      0    nvidia
cuda-nvrtc-dev            12.4.127                      0    nvidia
cuda-nvtx                 12.4.127                      0    nvidia
cuda-opencl               12.4.127                      0    nvidia
cuda-opencl-dev           12.4.127                      0    nvidia
cuda-profiler-api         12.4.127                      0    nvidia
cuda-runtime              12.4.0                        0    nvidia
cudatoolkit               11.3.1               h59b6b97_2
filelock                  3.15.4                   pypi_0    pypi
freetype                  2.12.1               ha860e81_0
gmpy2                     2.1.2            py38h7f96b67_0
google-auth               2.32.0                   pypi_0    pypi
google-auth-oauthlib      1.0.0                    pypi_0    pypi
grpcio                    1.65.1                   pypi_0    pypi
gym                       0.26.2                   pypi_0    pypi
gym-notices               0.0.8                    pypi_0    pypi
h5py                      3.11.0                   pypi_0    pypi
icc_rt                    2022.1.0             h6049295_2
idna                      3.7              py38haa95532_0
importlib-metadata        8.2.0                    pypi_0    pypi
intel-openmp              2023.1.0         h59b6b97_46320
jinja2                    3.1.4            py38haa95532_0
jpeg                      9e                   h827c3e9_2
lcms2                     2.12                 h83e58a3_0
lerc                      3.0                  hd77b12b_0
libcublas                 12.4.2.65                     0    nvidia
libcublas-dev             12.4.2.65                     0    nvidia
libcufft                  11.2.0.44                     0    nvidia
libcufft-dev              11.2.0.44                     0    nvidia
libcurand                 10.3.5.147                    0    nvidia
libcurand-dev             10.3.5.147                    0    nvidia
libcusolver               11.6.0.99                     0    nvidia
libcusolver-dev           11.6.0.99                     0    nvidia
libcusparse               12.3.0.142                    0    nvidia
libcusparse-dev           12.3.0.142                    0    nvidia
libdeflate                1.17                 h2bbff1b_1
libffi                    3.4.4                hd77b12b_1
libjpeg-turbo             2.0.0                h196d8e1_0
libnpp                    12.2.5.2                      0    nvidia
libnpp-dev                12.2.5.2                      0    nvidia
libnvfatbin               12.4.127                      0    nvidia
libnvfatbin-dev           12.4.127                      0    nvidia
libnvjitlink              12.4.99                       0    nvidia
libnvjitlink-dev          12.4.99                       0    nvidia
libnvjpeg                 12.3.1.89                     0    nvidia
libnvjpeg-dev             12.3.1.89                     0    nvidia
libpng                    1.6.39               h8cc25b3_0
libprotobuf               3.20.1               h23ce68f_0
libtiff                   4.5.1                hd77b12b_0
libuv                     1.48.0               h827c3e9_0
libwebp-base              1.3.2                h2bbff1b_0
lz4-c                     1.9.4                h2bbff1b_1
markdown                  3.6                      pypi_0    pypi
markupsafe                2.1.5                    pypi_0    pypi
mkl                       2023.1.0         h6b88ed4_46358
mkl-service               2.4.0            py38h2bbff1b_1
mkl_fft                   1.3.8            py38h2bbff1b_0
mkl_random                1.2.4            py38h59b6b97_0
mlagents                  0.30.0                   pypi_0    pypi
mlagents-envs             0.30.0                   pypi_0    pypi
mpc                       1.1.0                h7edee0f_1
mpfr                      4.0.2                h62dcd97_1
mpir                      3.0.0                hec2e145_1
mpmath                    1.3.0            py38haa95532_0
networkx                  3.1              py38haa95532_0
numpy                     1.19.5                   pypi_0    pypi
oauthlib                  3.2.2                    pypi_0    pypi
onnx                      1.16.1                   pypi_0    pypi
openjpeg                  2.4.0                h4afccc4_2
openssl                   3.0.14               h827c3e9_0
pettingzoo                1.15.0                   pypi_0    pypi
pillow                    10.4.0           py38h827c3e9_0
pip                       24.0             py38haa95532_0
protobuf                  3.20.2                   pypi_0    pypi
pyasn1                    0.6.0                    pypi_0    pypi
pyasn1-modules            0.4.0                    pypi_0    pypi
pypiwin32                 223                      pypi_0    pypi
pysocks                   1.7.1            py38haa95532_0
python                    3.8.19               h1aa4202_0
pytorch-cuda              12.4                 h3fd98bf_6    pytorch
pytorch-mutex             1.0                        cuda    pytorch
pywin32                   306                      pypi_0    pypi
pyyaml                    6.0.1            py38h2bbff1b_0
requests                  2.32.3           py38haa95532_0
requests-oauthlib         2.0.0                    pypi_0    pypi
rsa                       4.9                      pypi_0    pypi
setuptools                69.5.1           py38haa95532_0
six                       1.16.0                   pypi_0    pypi
sqlite                    3.45.3               h2bbff1b_0
sympy                     1.12             py38haa95532_0
tbb                       2021.8.0             h59b6b97_0
tensorboard               2.14.0                   pypi_0    pypi
tensorboard-data-server   0.7.2                    pypi_0    pypi
torch                     1.10.0+cu113             pypi_0    pypi
torchaudio                0.10.0+cu113             pypi_0    pypi
torchvision               0.11.1+cu113             pypi_0    pypi
typing_extensions         4.11.0           py38haa95532_0
urllib3                   2.2.2            py38haa95532_0
vc                        14.2                 h2eaa2aa_4
vs2015_runtime            14.29.30133          h43f2093_4
werkzeug                  3.0.3                    pypi_0    pypi
wheel                     0.43.0           py38haa95532_0
win_inet_pton             1.1.0            py38haa95532_0
xz                        5.4.6                h8cc25b3_1
yaml                      0.2.5                he774522_0
zipp                      3.19.2                   pypi_0    pypi
zlib                      1.2.13               h8cc25b3_1
zstd                      1.5.5                hd43e919_2

 

 

GPU 연결 확인

CUDA가 설치가 잘됐고 사용가능한지 보는 파이썬 코드도 올려드리겠습니다.
import torch

if torch.cuda.is_available():
    device = torch.device("cuda")
    print("GPU 사용:", torch.cuda.get_device_name(0))
else:
    device = torch.device("cpu")
    print("GPU 사용 불가능")

이런식으로 사용하시면 됩니다.

 

 

참고 블로그

>> Unity ML-Agent 설치하기

 

Unity ML-Agent 설치하기

이번 포스팅은 가상공간에서 강화학습을 이용해 인공지능을 학습할 수 있는 환경을 제공하는 Unity ML-Agent를 설치하는 과정입니다. 이 포스트는 아래 내용을 참고했습니다. github: https://github.com/Un

with-rl.tistory.com

 

>> ml-agent 설정

 

ml-agent 설정

WSL2에서 mlagent 설치시 이런 저런 dependency를 강하게 받는다0.30.0 버전 설치시 아래의 요구사항이 있다https://unity-technologies.github.io/ml-agents/Installation/python 3.8.13 ~

velog.io

 

반응형