设为首页 加入收藏

TOP

tensorflow在windows在安装
2019-05-11 02:29:37 】 浏览:70
Tags:tensorflow windows 安装

过程非常不容易,记录学习过程

https://www.tensorflow.org/install/install_windows

下载:

Anaconda3-4.4.0-Windows-x86_64.exe

cuda_8.0.61.2_windows.exe(英伟达显卡才装,GPU安装)

cuda_8.0.61_windows.exe


#设置清华源/阿里云源

#1.Anaconda Prompt,输入清华仓库镜像
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --set show_channel_urls yes

#2.阿里云源

#C:\Users\xx\pip,新建文件pip.ini

trusted-host=mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple/


#首先建立一个conda计算环境
conda create --name tensorflow python=3.6
#可以看到channels等信息
conda config --show
#进入tensorflow
activate tensorflow
#退出tensorflow
deactivate



#激活环境
activate tensorflow

#下面两个文件提前下载(记得开翻墙)

#1.安装cpu版本的TensorFlow
pip install --upgrade --ignore-installed tensorflow

#2.安装cpu版本的TensorFlow(1和2可选)
pip install --upgrade --ignore-installed tensorflow

或者

pip install F:\develop\Tensorflow\whl\numpy-1.11.3+mkl-cp36-cp36m-win_amd64.whl

pip install F:\develop\Tensorflow\whl\tensorflow-1.2.1-cp36-cp36m-win_amd64.whl

>python

>import tensorflow as tf(没有错误就是成功)


--------------------测试-------------------

import tensorflow as tf
hello = tf.constant('Hello, TensorFlow!')
sess = tf.Session()
sess.run(hello)
a = tf.constant(10)
b= tf.constant(32)
print(sess.run(a+b))
print("Hello World")

--------------------------------------------

注意:

用spyder执行不行(可能)
用pycharm IDE上可以


#########打开tensorboard,浏览器上显示

#激活环境
activate tensorflow

python -m tensorflow.tensorboard --logdir="C:\tmp\tensorflow"
http://localhost:6006/


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇HOJ 1030 Labyrinth-------------.. 下一篇java NIO(一)

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目