TensorFlow environment set up under the Anaconda

大二上学期,笔者有幸能参与到老师的一个计算机视觉方面的项目,用了一段时间自学python后,准备搭建TensorFlow框架,结果尝尽了苦头,遇到各种问题,经过一段时间的摸索后,也有了一定的经验,现在整理成这篇博客发布出来,希望能为对机器学习感兴趣的小伙伴有所帮助。
(注:因为开发环境不同,不一定适合所有人)

# 1.Anaconda installation
Anaconda is an open source python release, contains a large number of scientific packages, such as numpy, conda and so on, if you need only a part of the package, you can choose to use Miniconda this small release (containing only conda and python ).
Download
(https://www.anaconda.com/download/)
the latest version of Anaconda for Python3.7, I initially installed the python3.7 version, but in the later study found a number of packages and not of cp37 version, so only in exchange for python3.6 version of Anaconda.
(Note: Anaconda on corresponds to python3.6 version of the self in the online search, installation and subsequent environment variable settings and verify success to solve your own, here is not enumerate) ( it is not cold hands do not want to write )
# 2. TensorFlow - the CPU and GPU
## 2.1 PIP
often occur in python package download some time time out, after all, many have to go outside the network to download, this time with some domestic mirror relatively fast, are listed below Some common mirror website:
Qinghua: https: //pypi.tuna.tsinghua.edu.cn/simple/
USTC: https: //pypi.mirrors.ustc.edu.cn/simple/
Ali cloud: https: // mirrors .aliyun.com / pypi / simple /
watercress: http: //pypi.douban.com/simple/
As for use, an example is given below:
PIP install -i https://pypi.tuna.tsinghua.edu.cn/simple/ tensorflow-GPU = 1.14.0
## 2.2 About TensorFlow choose the version of
this connection, I emotionally, TensorFlow for many packages are required, version can not be too high nor too low, otherwise it can not be used TensorFlow. (Tf into the pit really is ......), well, get down to business, TensorFlow CPU and GPU has two versions, if you want to use the GPU version of tf, your computer must have first N card (NVIDIA), will be introduced later N configuration on the card. As for CPU version, I think we should be able to install.
Why GPU version, because the object TensorFlow dealing Graph, in a subsequent study, we will be training data set, if CPU, time will be longer than the GPU.
# 3. CUDA and CUDNN installation
correspondence regarding TensorFlow and CUDA and CUDNN version, and how to install, as it has introduced a number of blog, and I do not say (their own hands and clothing).
Here mention a few considerations:
(1) CUDA and cudnn version must correspond to good.
(2) Installation environment variable
(3) TensorFlow corresponding version of python may look official website: https://tensorflow.google.cn/install/source_windows
(. 4) to view the graphics driver version Method:
Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
(5) If the driver needs Quguan network upgrade can download the upgrade software (GeForce Experience)
(6) When installing the installation package cuda and outer cudnn some patches, the proposed installation at
the example (7) where I is given cudnn10.0 TensorFlow 1.14.0 Python 3.6 cuda10.0
# 4. Installation TensorFlow
mounting TensorFlow after -gpu, can easily verify, open cmd, enter python, enter
import tensorflow as tf enter it, as follows:
Here Insert Picture Description
error number of packets that do not match can occur during the installation process, the author of several known given its own recommendations:
(1) PIP needs to be upgraded, enter python -m pip install --upgrade pip to
(2) eRROE: can not uninstall 'wrapt' It is a distutils insatlled project .......
solution: enter pip install -U - Installed wrapt enum34-simplejson the ignore the netaddr
(. 3) ERROR: Requirement tensorboard 1.14.0 has setuptppls> = 41.0.0, 39.1.0 But you'll have have the setuptools Which IS Incompatible.
solution: setuptools updated version is too low for an
input: pip --upgrade setuptools install
(4) numpy version too
(5) h5py version unsuitable
last two errors can find a solution on their own.
# 5. Summary
first time I write a blog, can be considered finished, hoping to bring some help for everyone, soon the New Year, hope for the future getting better and better academic success, everything is smooth (laughs).

Published an original article · won praise 0 · Views 26

Guess you like

Origin blog.csdn.net/qq_44531736/article/details/103979434