目录
Ubuntu下使用conda在虚拟环境中安装CUDA、CUDNN及Tensorflow
Conda - Downloaded bytes did not match Content-Length 问题解决方案
-
前言
最近深度学习越来越跑火,同时近两年CVPR上出现不少轻量级的深度学习模型,使得模型落地移动端变的现实可行,由于自己以前主要是研究机器学习,机器学习比深度学习涵盖的范围更广,而且针对的对象比深度学习更为宽泛,而深度学习主要是图像和自然语言处理应用的多一些,所以最近准备开始入门深度学习,学习新的东西,而学习新的东西难免需要依靠网络上的点点碎碎的知识,然后自己一点点的去消化理解,整合,因此写下这篇博客,整理自己认为写的比较好的博客或者比较有用的文章,最好是最后能够形成一个比较系统的教程,就不用再繁琐的去网络的海洋中去苦苦寻找和筛选我们想要的答案了。
-
基础概念和知识汇集
-
什么是PyTorch
-
Pytorch与CUDA的关系
-
windows下 为不同虚拟环境配置不同的cuda
-
使用Anaconda管理多个版本的Python环境
-
如何将Anaconda下的python更新到指定版本
-
CUDA与cuDNN的关系
-
pyTorch环境配置及安装
-
anaconda虚拟环境管理,从此Python版本不用愁
-
Ubuntu下使用conda在虚拟环境中安装CUDA、CUDNN及Tensorflow
-
安装过程中问题汇集
-
Conda - Downloaded bytes did not match Content-Length 问题解决方案
-
更改pip源至国内镜像,显著提升下载速度
-
win10中anaconda安装pytorch的错误
-
Anaconda清华镜像源的使用及安装Pytorch失败问题解决(这篇博客的最后一句话很重要!!!)
-
conda 常用指令
//创建一个虚拟环境
conda create -n your_env_name python=X.X
//激活虚拟环境
conda activate your_env_name
//设置conda下载的timeout,如果时长不够可以再设置大一点。
conda config --set remote_read_timeout_secs 600.0
//清华源安装cuda
conda install cudatoolkit=8.0 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64/
//清华源安装cudann
conda install cudnn=7.0.5 -c https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/linux-64/
//配置清华源
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/pro/
conda config --add channels http://mirrors.aliyun.com/pypi/simple/
conda config --add channels https://pypi.mirrors.ustc.edu.cn/simple/
conda config --add channels http://pypi.douban.com/simple/
conda config --add channels https://pypi.tuna.tsinghua.edu.cn/simple
conda config --add channels http://pypi.mirrors.ustc.edu.cn/simple
//清除配置的channels,恢复默认channels
conda config --remove-key channels
//安装包安装cuda
conda install --offline ./cudnn-7.0.5-cuda8.0_0.tar.bz2
//清除虚拟环境
conda remove -n your_env_name --all
//查到库版本
conda search torchvison
//查看channels
conda config --show
//查看pytorch是否安装成功
import torch
import torchvision
print(torch.cuda.is_available())
-
总结
把上面列出的几篇博客认认真真研究完,基本上配置pytorch环境就基本原理和操作流程就能很清晰了,主要是要理清楚头绪,为什么要用anaconda管理不同的版本以及如何去管理版本。