anaconda中配置pytorch(win和linux一样)

在conda中配置环境pytorch环境:

注意:gpu版首先要安装CUDA和cudnn,cpu可以忽略。

设备要求:Compute Capability https://developer.nvidia.com/cuda-gpus

  1. nVidia  GTX650 or newer
  2. anaconda with python 3.6 or3.5
  3. CUDA tool kit  (version 8)
  4. cudnn(version 6)

可以根据自己的设备选择CUDA版本:https://developer.nvidia.com/cuda-toolkit-archive

安装CUDA时可以直接默认安装,不做改变,具体修改的可以看一下自己不需要的,不勾选即可。

安装后在终端中用nvcc -V查看版本,即可。

再选择cudnn版本:https://developer.nvidia.com/rdp/cudnn-download,需要将指定的文件移动到CUDA安装路径下。

 pytorch离线安装:

在官网根据python、CUDA版本下载指定的whl文件,进行离线安装:

Linux and Windows

扫描二维码关注公众号,回复: 9167665 查看本文章

# CUDA 10.0
Download and install wheel from https://download.pytorch.org/whl/cu100/torch_stable.html

# CUDA 9.0
Download and install wheel from https://download.pytorch.org/whl/cu90/torch_stable.html

# CUDA 8.0
Download and install wheel from https://download.pytorch.org/whl/cu80/torch_stable.html

# CPU only
Download and install wheel from https://download.pytorch.org/whl/cpu/torch_stable.html

安装pytorch:

pip install **.whl

发布了7 篇原创文章 · 获赞 10 · 访问量 6883

猜你喜欢

转载自blog.csdn.net/zahidzqj/article/details/104317423