VScode 주피터 커널 등록
가상환경 생성 후 vscode 주피터에서 쓰고 싶으면 커널에 등록해줘야함.
$ conda create -n [가상환경이름] python=3.8
$ pip install ipykernel
$ python -m ipykernel install --user --name [가상환경이름] --display-name [가상환경이름]
+ 터미널에서 가상환경이 안뜨는 경우
ctrl + shift + p → Python: select interpreter -> 가상환경 선택!
CUDA에 맞는 torch 설치
$ nvcc --version
으로 쿠다 버전 확인 후, torch, torchvision 해당 쿠다에 맞게 install
이전버전
https://pytorch.org/get-started/previous-versions/
ex) CUDA 11.3
$ conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.3 -c pytorch
최신버전(CUDA 11.7 ↑ ?)
https://pytorch.org/get-started/locally/
ex) CUDA 11.8
$ pip3 install numpy --pre torch torchvision torchaudio --force-reinstall --index-url https://download.pytorch.org/whl/nightly/cu118
'서버,아나콘다,vscode' 카테고리의 다른 글
Linux에서 Anaconda 설치 (0) | 2023.04.25 |
---|---|
VSCode SSH 원격서버 접속하기 (0) | 2023.02.15 |
[conda] 아나콘다 가상환경 세팅하기 (0) | 2023.01.17 |