Anaconda 安装
CUDA
conda install cudnn=7.1.2
Python及Pytorch安装
创建 Python 环境
conda create --name planercnn python=3.7
激活Python环境
conda activate planercnn
安装Pytorch 0.4.1
conda install pytorch=0.4.1 -c pytorch
安装torchvision
conda install torchvision -c pytorch
输入 python,之后输入 import torch,如果没有报错,意味着 pytorch 已经顺利安装了,接下来输入 torch.cuda.is_available(),如果是 True,意味着可以使用 GPU训练,如果是 False,意味着只能使用CPU了。
import torch
torch.cuda.is_available()
torch.backends.cudnn.version()

错误1
运行 conda activate planercnn 时会报错如下:
CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run
$ conda init <SHELL_NAME>
Currently supported shells are:
- bash
- fish
- tcsh
- xonsh
- zsh
- powershell
See 'conda init --help' for more information and options.
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
如果执行conda init powershell,重启后依然报错如下:
无法加载文件 C:\Users\cgnerds\Documents\WindowsPowerShell\profile.ps1,因为在此系统上禁止运行脚本。有关详细信息,请参阅 https:/go.microsoft.com/fwlink/?LinkID=135170 中的 about_Execution_Policies。 所在位置 行:1 字符: 3 'C:\Users\cgnerds\Documents\WindowsPowerShell\profile.ps1'
可使用管理员权限打开powershell,并运行如下命令即可解决。
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
错误2

CUDA 9 unsupported error with Visual Studio 2017
586

被折叠的 条评论
为什么被折叠?



