1. miniforge 설치
# By brew
brew install mimiforge
# Or install by wget
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
rm https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh # Cleanup.
2. conda 환경생성 & torch 설치
# Create env
conda create -n pytorch
conda activate pytorch
conda install python
# install torch
pip install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu
3. 설치확인
import torch
torch.device('mps')
# device(type='mps')
torch.__version__
# '1.13.0.dev20220603'
torch.tensor([1,2,3], device="mps")
# tensor([1, 2, 3], device='mps:0')
Reference
Install PyTorch on Apple M1 (M1, Pro, Max) with GPU (Metal) (sudhanva.me)
'개발' 카테고리의 다른 글
[Keras] module 'keras.engine' has no attribute 'Layer' 문제해결 (0) | 2022.10.13 |
---|---|
[Python] 모든 열, 모든 행 보기 (0) | 2022.10.07 |
Building simple app from python (0) | 2022.09.29 |
PBS (Profile Batch System) 교육 (0) | 2022.05.24 |
WSL 사용 하여 작업 시 서버와 병행해서 네트워크 드라이브를 마운트 해야 하는 경우 (0) | 2022.05.17 |
댓글