--- title: 'anaconda PyTorch 環境架設(ubuntu 20.04)' disqus: hackmd --- anaconda PyTorch 環境架設(ubuntu 20.04) === [TOC] ## 1. Anaconda 下載與安裝 [Anaconda下載](https://www.anaconda.com/products/individual#windows)  ## 2. 使用 Anaconda Prompt(anaconda3) 創建 python3.7 環境 創造一個 conda for PyTorch 環境 ```gherkin= conda create -n pytorch python=3.7 ``` 切進環境 ```gherkin= conda activate pytorch ```  ## 3.安裝 PyTorch [獲得安裝指令](https://pytorch.org/get-started/locally/)  ```gherkin= conda activate pytorch conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch ``` 安裝後驗證 ```gherkin= conda activate pytorch python import torch ```  ```gherkin= import torchvision torchvision.__version__ ```  驗證 CUDA 是否可用 ```gherkin= torch.cuda.is_available() torch.cuda.get_device_name() ```  ```gherkin= torch.cuda.device_count() ```  CUDA ID ```gherkin= torch.cuda.current_device() ```  CUDA 裝置名稱 ```gherkin= torch.cuda.get_device_name(0) ```  ## 4.安裝 conda 相關套件 ```gherkin= pip install jupyterlab conda install -c conda-forge matplotlib -n pytorch conda install -c anaconda pandas -n pytorch pip install torchsummary pip install torch pip install opencv-python pip install opencv-contrib-python ``` ###### tags: `setup`, `Python`
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.