- 페이스북(메타)의 오픈소스 머신 러닝 라이브러리, 딥러닝 프레임워크

   - 파이토치 이외에 구글의 텐서플로(TensorFlow), 케라스(Keras)


//-------------------------------------
* 최신 버전 설치

https://pytorch.org/get-started/locally/
    - conda 용
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia

    - pip 용
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118

 

//-------------------------------------

    - 이전 버전 설치 정보

https://pytorch.org/get-started/previous-versions/


//-------------------------------------
* 설치 확인

    - python 코드
python -c "import torch; print(torch.__version__, torch.cuda.is_available())"  

    - conda 용
conda list torch

    - pip 용
pip list | grep torch


//-------------------------------------
* 제거
    - conda 용
conda uninstall pytorch torchvision torchaudio pytorch-cuda

    - pip 용
pip uninstall torch torchvision torchaudio



//-------------------------------------
* pytorch 최신버전(v2.0) 강제 설치(업데이트)
    - 방법1 : pytorch 제거 후 설치 - conda

    - 방법2 :
    - conda 용 : 
주의! 'conda update pytorch torchvision torchaudio' 제대로 작동 안함

    - pip 용
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 --upgrade



//-----------------------------------------------------------------------------
* 이전 버전 설치
https://pytorch.org/get-started/previous-versions/

Domain Version Compatibility Matrix for PyTorch
https://github.com/pytorch/pytorch/wiki/PyTorch-Versions


//-------------------------------------
예) v1.13.1 , CUDA 11.7

    - conda 용
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia

    - pip 용
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117


 

https://download.pytorch.org/whl/cu117

 

download.pytorch.org

//-----------------------------------------------------------------------------

< 참고 > conda vs pip

conda와 pip를 이용한 패키지 설치의 다른점

패키지 사용시 다른점은 없고

pip는 파이썬 패키지만을 설치할 수 있지만

conda는 파이썬 패키지와 python 자체, 운영체체에 필요한 라이브러리까지 설치할 수 있음

pip에서 conda와 같이 부가적인 라이브러리를 설치 하려면 pip wheel을 사용

 

https://pythonspeed.com/articles/conda-vs-pip/

 

  pip Conda
Installs Python No Yes, as package
3rd-party shared libraries Inside the wheel Yes, as package
Executables and tools No Yes, as package
Python source code Yes, as package Yes, as package

 //

반응형

'AI' 카테고리의 다른 글

AI 이미지 업스케일러 'Real-ESRGAN ' 사용법  (0) 2023.04.28
AI Text to Speech "coqui-ai /TTS" 사용법  (0) 2023.04.28
(Meta AI) LLaMA 4bit 실행 방법  (0) 2023.03.22
text-generation-webui 사용법  (0) 2023.03.21
(Meta AI) LLaMA 사용법  (0) 2023.03.21
Posted by codens