table of Contents
This tutorial is for personal learning use, not for commercial profit, resulting in at your peril! ! !
1, Anaconda download and install
(1) Anaconda download URL: https://www.anaconda.com/distribution/ , according to the median its own system, and the system, select the desired version. Here is my Windows64-bit systems.
(2) download, select the installation package, click the Next
(3) Select the "I agree" option
(4) you can select Just Me
(5) Click the Select installation path "Browse", the next step is to wait for the installation, the installation very Fast.
At the end of (6) the progress bar, select the next button
(7) unchecked, then click on the "Finish" button to complete the installation.
***
2, Anaconda installation test success
(1) into the Windows system interface cmd: Then enter: conda --version
Check the version of the anaconda
(2) Check the currently installed what environment variables: conda info --envs
, as is the success shown
***
3, install python
(1)需要安装一个Python解译器,可以使用conda search --full -name python
(Anaconda如果比较新的版本,可以使用conda search --full --name python
)检查支持的Python版本。我安装的就是比较新的版本,所以使用的是conda search --full --name python
检查Python版本
(2)安装Python解译器:conda create --name tensorflow python=3.6
,我安装的是3.6版本,你可以根据自己需要安装自己的需要选择版本。(为了不出错,建议你也安装3.6版本)
***
4、检查TensorFlow环境添加成功与否
(1)激活tensflow的环境:activate tensorflow
(2)检测tensflow的环境添加到了Anaconda里面:conda info --envs
(3)退出tensorflow的环境:deactivate tensorflow
(不过这里不需要退出哈,因为我们要进行TensorFlow安装)
***
5、TensorFlow安装
前提: 在激活TensorFlow情况下(即前边有tensorflow字样),如果没有激活,需使用:activate tensorflow
进行激活
(1)使用如下命令进行安装TensorFlow:pip install --upgrade --ignore-installed tensorflow
,等待安装就可以了。
提示: 如果提示需要你升级你的pip的版本,那么你就根据上面的提示进行命令安装就可以了。我这里就遇到了,所以我升级了版本:python -m pip install --upgrade pip
。
(2)安装TensorFlow:pip install --upgrade --ignore-installed tensorflow
***
6、测试TensorFlow安装是否成功
(1) Open Anaconda previously installed, selecting prompt
(2) used activate tensorflow
to switch to tensorflow environment
(3) enter python
into the Python build environment
(4) successively enter the following command:
import tensorflow as tf
hello = tf.constant('hello,tf')
sess = tf.Session()
print(sess.run(hello))
(5) The results shown below indicate the test was successful:
***
7, arranged to Pycharm TensorFlow
After installing TensorFlow, we need the corresponding Python interpreter configured to Pycharm in to be able to carry out the implementation of the program, the configuration steps are as follows:
(1) Open Pycharm, click settings under the "file" menu
(2) Click "Project: Pycharm "in the" Project Interpreter ", click on the right under the small triangle" Add "button to add the Python install under TensorFlow
later (3) configured, enter the following code:
import tensorflow as tf
hello = tf.constant('hello,tf')
sess = tf.compat.v1.Session()
print(sess.run(hello))
Results of the: