1 Star 0 Fork 2

睿思学院/深度学习编程技术入门

forked from yunxiang/深度学习 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

1. Windows环境

1.1 Windows10

安装windows10 64位,家庭版/专业版不限,visual studio c++组件需要安装升级完整,python部分库对此有依赖。

1.2 python3.9.6 windows 64位

1)python官网主页: https://www.python.org/

2)python windows版下载主页:https://www.python.org/downloads/windows/

3)python windows 3.9.6版下载地址:

https://www.python.org/ftp/python/3.9.6/python-3.9.6-amd64.exe

4)python windows 3.9.6版国内镜像下载地址:

http://npm.taobao.org/mirrors/python/3.9.6/python-3.9.6-amd64.exe

5)python镜像配置: (注:python镜像对于提高python库的下载速度至关重要,强烈建议配置)

windows下,直接在user目录中创建一个pip目录,再新建文件pip.ini(例如:C:\Users\xxx\pip\pip.ini):

注意:

  1. xxx是本机用户名,大家注意改成自己电脑登录用户名;

  2. C:\Users在win10中文操作系统下打开我的电脑C盘,显示的是汉字”用户”,点击上方地址栏会自动切换为”C:\Users”显示,实质指向的都是同一个目录

创建的pip.ini内容如下:

[global]

index-url = https://pypi.tuna.tsinghua.edu.cn/simple

[install]

trusted-host=mirrors.aliyun.com

1.3 pip升级到最新版

pip install --upgrade pip

1.4 anaconda (可选)

1.5 CUDA (可选,视显卡支持情况而定)

https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=10&target_type=exe_local

![img](file:///C:/Users/isrc/AppData/Local/Temp/msohtmlclip1/01/clip_image002.gif)

1.6 cuDNN

NVIDIA CUDA深度神经网络库 (cuDNN) 是经GPU加速的深度神经网络基元库。cuDNN可大幅优化标准例程(例如用于前向传播和反向传播的卷积层、池化层、归一化层和激活层)的实施。

世界各地的深度学习研究人员和框架开发者都依赖cuDNN实现高性能GPU加速。借助cuDNN,研究人员和开发者可以专注于训练神经网络及开发软件应用,而不必花时间进行低层级的GPU性能调整。cuDNN可加速广泛应用的深度学习框架,包括 Caffe2、Chainer、Keras、MATLAB、MxNet、PyTorch和TensorFlow。

cuDNN是目前Tensorflow GPU运行必须依赖的库,PyTorch无此依赖。

1.7 PyTorch

1)配置&下载页面:https://pytorch.org/get-started/locally/

![img](file:///C:/Users/isrc/AppData/Local/Temp/msohtmlclip1/01/clip_image004.gif)

2)生成下载地址:

pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio===0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

输入以上指令后,控制台显示:

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/

Looking in links: https://download.pytorch.org/whl/torch_stable.html

Collecting torch==1.9.0+cu111

Downloading https://download.pytorch.org/whl/cu111/torch-1.9.0%2Bcu111-cp39-cp39-win_amd64.whl (3128.0 MB)

下载非常慢

尝试配置镜像:

pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio===0.9.0 -i https://pypi.tuna.tsinghua.edu.cn/simple
 
运行错误,镜像没有该版本 :
ERROR: Could not find a version that satisfies the requirement torch==1.9.0+cu111 (from versions: 0.1.2, 0.1.2.post1, 0.1.2.post2, 1.7.1, 1.8.0, 1.8.1, 1.9.0)           ERROR: No matching distribution found for torch==1.9.0+cu111  
 
解决办法:
前往https://download.pytorch.org/whl/torch_stable.html浏览器找到以下内容直接下载:
 
torch-1.9.0+cu111-cp39-cp39-win_amd64.whl
torchvision-0.10.0+cu111-cp39-cp39-win_amd64.whl
torchaudio-0.9.0-cp39-cp39-win_amd64.whl
 
或者直接输入链接:Downloading https://download.pytorch.org/whl/cu111/torch-1.9.0%2Bcu111-cp39-cp39-win_amd64.whl 

whl格式本质上是一个压缩包,里面包含了py文件,以及经过编译的pyd文件。使得可以在不具备编译环境的情况下,选择合适自己的python环境进行安装。

离线安装whl包:

pip install wheel

pip install xxx.whl

1.8 Tensorflow

1)中文官网:https://tensorflow.google.cn/?hl=zh-cn

2)安装:https://tensorflow.google.cn/install?hl=zh_cn

Tensorflow的安装环境要求:

1)Python 3.5–3.9,建议采用Python3.9

2)Ubuntu 16.04 或更高版本

3)Windows 7 或更高版本(含C++可再发行软件包:

https://support.microsoft.com/help/2977003/the-latest-supported-visual-c-downloads)

4)macOS 10.12.6 (Sierra) 或更高版本(不支持 GPU)

GPU需要使用支持CUDA®的显卡(只适用于Ubuntu和Windows)

5)使用Python的pip软件包管理器安装TensorFlow,TensorFlow 2软件包需要使用高于19.0的pip版本,需要先对pip升级:

pip install --upgrade pip

Tensorflow安装命令:

对于1.15及更早版本,CPU和GPU软件包是分开的:(注意不要被网上过期文章干扰了)

pip install tensorflow==1.15   # CPU

pip install tensorflow-gpu==1.15 # GPU

当前版本安装只需要:

pip install tensorflow

安装过程有类似提示:

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/

Collecting tensorflow

Downloading http://mirrors.aliyun.com/pypi/packages/84/b5/8e3ef8335e8147cb74448bf31757b8b4eaac9f6b25c1e312a857ca4b4d08/tensorflow-2.5.0-cp39-cp39-win_amd64.whl (422.6 MB)

安装过程中可能遇到的问题

Tensorflow的GPU使用,除了安装CUDA,还需要安装cuDNN,同时还要把cuda\bin\cudnn64_8.dll复制到CUDA的安装目录D:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin下,否则提示Could not load dynamic library 'cudnn64_8.dll'

以上还需要设置环境变量path:

D:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\bin;

D:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\libnvvp;

D:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\extras\CUPTI\lib64;

D:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.4\include;

D:\cudnn\cuda\bin;

1.9 Python相关库安装:

建议直接采用pip install xxx 安装,相关依赖会自动安装。建议不要依赖anaconda进行安装。

1)NumPy

2)Matplotlib

3)Pandas

4)Keras

2.0 pycharm-community-2021.1.3 for windows

初学者和生产环境开发建议采用pycharm,juypter建议作为学习使用。

2.1 Docker(可选,主要便于容器化操作,减少环境依赖)

1)windows版docker下载地址:https://hub.docker.com/editions/community/docker-ce-desktop-windows/

Requires Microsoft Windows 10 Professional or Enterprise 64-bit, or Windows 10 Home 64-bit with WSL 2.

2)安装

wsl.exe --install

2.2 Jupyter

1)主页:https://jupyter.org/

2)安装指导:https://jupyter.org/install.html

安装jupyterlab

pip install jupyterlab

安装Jupyter Notebook

pip install notebook

运行Jupyter Notebook:

jupyter notebook

2.3 OpenCV

  1. 主页:https://opencv.org/

  2. OpenCV下载地址:https://opencv.org/releases/

  3. 安装指导:双击运行安装包,安装提示进行安装即可。

  4. OpenCV配置:按照以下步骤进行环境变量配置:

开始菜单右键->系统->系统信息->高级系统设置->高级->环境变量>“系统变量中的PATH”->编辑->新建->添加OpenCV相关路径后点击确定即可。

安装路径目录\opencv\build\x64\vc15\bin

  1. Python安装
pip install opencv-python

![img](file:///C:/Users/isrc/AppData/Local/Temp/msohtmlclip1/01/clip_image006.jpg)

2. Linux环境

  1. Ubuntu20

  2. python3.8.7 for linux

  3. pip升级到最新版

  4. anaconda(可选)

  5. CUDA(可选,视显卡支持情况而定)

  6. PyTorch

  7. Tensorflow

  8. Python相关库:NumPy, Matplotlib, Pandas, Keras

  9. pycharm-community-2021.1.3 for Linux

空文件

简介

取消

发行版

暂无发行版

贡献者

全部

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ros-institute/deeplearning.git
git@gitee.com:ros-institute/deeplearning.git
ros-institute
deeplearning
深度学习编程技术入门
master

搜索帮助