1.在python官网下载3.5 64位版本的python,并进行安装

https://www.python.org/

2.进行安装,配置环境变量

3.命令行执行pip3 install numpy

4.命令行执行pip3 install tensorflow

5.运行测试

将以下代码保存到test.py中,然后通过python test.py运行

import tensorflow as tf
import numpy as np x_data = np.random.rand(100).astype(np.float32)
y_data = x_data*0.1 + 0.3 Weights = tf.Variable(tf.random_uniform([1], -1.0, 1.0))
biases = tf.Variable(tf.zeros([1])) y = Weights*x_data + biases loss = tf.reduce_mean(tf.square(y-y_data)) optimizer = tf.train.GradientDescentOptimizer(0.5)
train = optimizer.minimize(loss) init = tf.global_variables_initializer() sess = tf.Session()
sess.run(init) for step in range(201):
sess.run(train)
if step % 20 == 0:
print(step, sess.run(Weights), sess.run(biases))

运行结果(我们计算 x*0.1+0.3=y tensorflow通过x与y的值,逼近0.1和0.3)

0 [-0.03866833] [ 0.56909722]
20 [ 0.0400503] [ 0.33504695]
40 [ 0.08370772] [ 0.30952457]
60 [ 0.09557232] [ 0.30258846]
80 [ 0.09879671] [ 0.30070347]
100 [ 0.099673] [ 0.30019119]
120 [ 0.09991115] [ 0.30005196]
140 [ 0.09997585] [ 0.30001414]
160 [ 0.09999346] [ 0.30000383]
180 [ 0.09999823] [ 0.30000106]
200 [ 0.09999952] [ 0.30000031]

6.如果出现报错,则安装搜索Microsoft Visual C++ 2015 Redistributable Update 3安装

https://www.microsoft.com/zh-CN/download/details.aspx?id=52685

Traceback (most recent call last):
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line , in swig_import_helper
return importlib.import_module(mname)
File "D:\Python35\lib\importlib\__init__.py", line , in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line , in _gcd_import
File "<frozen importlib._bootstrap>", line , in _find_and_load
File "<frozen importlib._bootstrap>", line , in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line , in _load_unlocked
File "<frozen importlib._bootstrap>", line , in module_from_spec
File "<frozen importlib._bootstrap_external>", line , in create_module
File "<frozen importlib._bootstrap>", line , in _call_with_frames_removed
ImportError: DLL load failed: 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line , in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line , in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line , in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "D:\Python35\lib\importlib\__init__.py", line , in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal' During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "test.py", line , in <module>
import tensorflow as tf
File "D:\Python35\lib\site-packages\tensorflow\__init__.py", line , in <module>
from tensorflow.python import *
File "D:\Python35\lib\site-packages\tensorflow\python\__init__.py", line , in <module>
from tensorflow.python import pywrap_tensorflow
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line , in <module>
raise ImportError(msg)
ImportError: Traceback (most recent call last):
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line , in swig_import_helper
return importlib.import_module(mname)
File "D:\Python35\lib\importlib\__init__.py", line , in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line , in _gcd_import
File "<frozen importlib._bootstrap>", line , in _find_and_load
File "<frozen importlib._bootstrap>", line , in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line , in _load_unlocked
File "<frozen importlib._bootstrap>", line , in module_from_spec
File "<frozen importlib._bootstrap_external>", line , in create_module
File "<frozen importlib._bootstrap>", line , in _call_with_frames_removed
ImportError: DLL load failed: 找不到指定的模块。 During handling of the above exception, another exception occurred: Traceback (most recent call last):
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow.py", line , in <module>
from tensorflow.python.pywrap_tensorflow_internal import *
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line , in <module>
_pywrap_tensorflow_internal = swig_import_helper()
File "D:\Python35\lib\site-packages\tensorflow\python\pywrap_tensorflow_internal.py", line , in swig_import_helper
return importlib.import_module('_pywrap_tensorflow_internal')
File "D:\Python35\lib\importlib\__init__.py", line , in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named '_pywrap_tensorflow_internal' Failed to load the native TensorFlow runtime. See https://www.tensorflow.org/install/install_sources#common_installation_problems for some common reasons and solutions. Include the entire stack trace
above this error message when asking for help.

tensorflowwindows安装的更多相关文章

  1. tensorflow-windows下安装,python3.6

    安装: pip install tensorflow ps:我第一次安装了,但是导入却失败了. 进入\python3\Lib\site-packages\删除了tensorflow,再次pip ins ...

  2. 【TensorFlow-windows】(零)TensorFlow的"安装"

    Tensorflow的安装,具体操作就不演示了.具体操作请移步: http://blog.csdn.net/darlingwood2013/article/details/60322258#comme ...

  3. docker——容器安装tomcat

    写在前面: 继续docker的学习,学习了docker的基本常用命令之后,我在docker上安装jdk,tomcat两个基本的java web工具,这里对操作流程记录一下. 软件准备: 1.jdk-7 ...

  4. 网络原因导致 npm 软件包 node-sass / gulp-sass 安装失败的处理办法

    如果你正在构建一个基于 gulp 的前端自动化开发环境,那么极有可能会用到 gulp-sass ,由于网络原因你可能会安装失败,因为安装过程中部分细节会到亚马逊云服务器上获取文件.本文主要讨论在不变更 ...

  5. Sublime Text3安装JsHint

    介绍 Sublime Text3使用jshint依赖Nodejs,SublimeLinter和Sublimelinter-jshint. NodeJs的安装省略. 安装SublimeLinter Su ...

  6. Fabio 安装和简单使用

    Fabio(Go 语言):https://github.com/eBay/fabio Fabio 是一个快速.现代.zero-conf 负载均衡 HTTP(S) 路由器,用于部署 Consul 管理的 ...

  7. gentoo 安装

    加载完光驱后 1进行ping命令查看网络是否通畅 2设置硬盘的标识为GPT(主要用于64位且启动模式为UEFI,还有一个是MBR,主要用于32位且启动模式为bois) parted -a optima ...

  8. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part3:db安装和升级 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 5.安装Database软件 5. ...

  9. Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作

    Linux平台 Oracle 10gR2(10.2.0.5)RAC安装 Part1:准备工作 环境:OEL 5.7 + Oracle 10.2.0.5 RAC 1.实施前准备工作 1.1 服务器安装操 ...

随机推荐

  1. thinkPHP 3.2.3操作MongoDB指南

    今天使用thinkPHP操作MongoDB发现跟用MYSQL有很多不同的地方,在这里特别跟大家分享下. 暂时没用thinkPHP5一直还在用thinkPHP3.2.3觉得挺好用,MongoDB版本2和 ...

  2. swoole创建工作进程,执行滞后工作

    一,创建守候进程,因为这里不需要Server,也没有Client,数据交换通过redis进行 <?php namespace Kuba\Saas; require_once __DIR__ . ...

  3. Android 如何让EditText不自动获取焦点 (转)

    在项目中,一进入一个页面, EditText默认就会自动获取焦点. 那么如何取消这个默认行为呢? 在网上找了好久,有点 监听软键盘事件,有点 调用 clearFouse()方法,但是测试了都没有! x ...

  4. win7下python2.6如何安装setuptools和pip

    1. 下载 setuptools-0.6c9.tar.gz 下载地址:http://pypi.python.org/packages/source/s/setuptools/setuptools-0. ...

  5. pytest.1.快速开始

    From: http://www.testclass.net/pytest/quick_start/ 简介 pytest测试框架可以让我们很方便的编写测试用例,这些用例写起来虽然简单,但仍然可以规模化 ...

  6. C++进阶--构造函数和析构函数中的虚函数

    //############################################################################ /* 任何时候都不要在构造函数或析构函数中 ...

  7. elasticsearch mapping demo

    curl -XPUT localhost:9200/local -d '{ "settings" : { "analysis" : { "analyz ...

  8. mysql获取某个表的所有属性名及其数据

    MYSQL类实现从数据库相应的表中获取所有属性及其数据,数据为元组类型.返回结果存放在字典中 import pymysql class MYSQL: def __init__(self): pass ...

  9. 峰Redis学习(3)Redis 数据结构(字符串、哈希)

    第一节:Redis 数据类型介绍 五种数据类型: 字符串(String) 字符串列表(list) 有序字符串集合(sorted set) 哈希(hash) 字符串集合(set)   第二节:Redis ...

  10. Hive数据类型及文本文件数据编码

    本文参考Apache官网,更多内容请参考:https://cwiki.apache.org/confluence/display/Hive/LanguageManual+Types 1. 数值型 类型 ...