tensorflow安装过程-(windows环境下)

1.Anaconda

1)下载地址:国内清华镜像网站是:https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/

2)命令行验证安装成功:命令窗口中输入“conda --version”  ----->得到conda 4.7.10

2.Tensorflow

1)修改镜像地址:

用国内清华镜像,需要改一下链接镜像的地址。这里,我们打开刚刚安装好的Anaconda中的 Anaconda Prompt,然后输入:

    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/     

              conda config --set show_channel_urls yes

2)安装Tensorflow:

conda create -n tensorflow python=3.5.2

安装成功显示:conda activate tensorflow

3)运行Tensorflow命令行输入:activate tensorflow

4)安装的是CPU版本:

--安装pip:python -m pip install --upgrade pip

--安装cpu命令:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple tensorflow

=======ERROR: tensorboard 1.14.0 has requirement setuptools>=41.0.0, but you'll have setuptools 36.4.0 which is incompatible.

解决更新setuptools版本 输入 pip install --upgrade setuptools

5)测试:

在Anaconda Prompt窗口中输入: python

    进入python后输入:

    import tensorflow as tf

    sess = tf.Session()

    a = tf.constant(10)

    b= tf.constant(12)

    sess.run(a+b)

 

 

posted @ 2019-09-04 09:48  yu_fly  阅读(372)  评论(0)    收藏  举报