![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow函数用法随笔
文章平均质量分 63
Never-Giveup
这个作者很懒,什么都没留下…
展开
-
tensorflow和numpy中的矩阵相乘和矩阵点乘
tensorflowtf.matmul() # 矩阵相乘tf.multiply() # 矩阵点乘numpynp.dot() # 矩阵相乘np.multiply() # 矩阵点乘原创 2018-07-18 00:21:34 · 1018 阅读 · 1 评论 -
查看TensorFlow的pb模型文件的ops和tensor并使用TensorBoard可视化
加载pb模型文件,并输出定义model = 'model.pb'with tf.Session() as sess: with open(model, 'rb') as model_file: graph_def = tf.GraphDef() graph_def.ParseFromString(f.read()) print(graph...原创 2019-01-17 16:25:27 · 5970 阅读 · 0 评论 -
TensorFlow中tf.Graph()函数
TensorFlow是谷歌基于DistBelief进行研发的第二代人工智能学习系统,其命名来源于本身的运行原理。Tensor(张量)意味着N维数组,Flow(流)意味着基于数据流图的计算,TensorFlow为张量从流图的一端流动到另一端计算过程。TensorFlow是将复杂的数据结构传输至人工智能神经网中进行分析和处理过程的系统。TensorFlow可被用于语音识别或图像识别等多项机器深度学习...原创 2018-12-25 22:14:12 · 4693 阅读 · 0 评论 -
TensorFlow训练模型的保存和加载
参考https://blog.csdn.net/tan_handsome/article/details/79303269原创 2018-12-04 21:53:06 · 1603 阅读 · 0 评论 -
TensorFlow中用于评估模型在训练集和测试集上的准确度的几个常用函数说明
1. tf.argmax() | tf.argmin()tf.argmax(input=tensor,dimention=axis) 找到给定的张量tensor中在指定轴axis上的最大值/最小值的位置。a=tf.get_variable(name='a', shape=[3,4], dtype=tf.float3...原创 2018-07-23 00:43:05 · 15605 阅读 · 1 评论 -
TensorFlow之tf.get_variable()和tf.Variable()的区别
tensorflow中有两个关于variable的op,tf.Variable()与tf.get_variable()下面介绍这两个的用法与区别:tf.Variable()W = tf.Variable(<initial-value>, name=<optional-name>)用于生成一个初始值为initial-value的变量。必须指定初始化值tf....原创 2018-07-23 00:19:33 · 510 阅读 · 0 评论 -
TensorFlow之app模块详解
大声道原创 2018-07-22 16:08:51 · 3262 阅读 · 1 评论 -
TensorFlow之神经网络layers模块详解
tf.nn,tf.layers, tf.contrib概述:我们在使用tensorflow时,会发现tf.nn,tf.layers, tf.contrib模块有很多功能是重复的,尤其是卷积操作,在使用的时候,我们可以根据需要现在不同的模块。但有些时候可以一起混用。 下面是对三个模块的简述: (1)tf.nn :提供神经网络相关操作的支持,包括卷积操作(conv)、池化操作(pooling)、归...原创 2018-07-22 15:54:34 · 7870 阅读 · 0 评论 -
TensorFlow之下载和导入mnists数据集的read_data_sets()错误分析(从源码的角度)
在用TensorFlow的mnist数据集做手写数字识别任务时,使用tensorflow自带的模块(如下所示)下载和导入数据集会报错,原因是该模块爬取的数据集网站不能访问。。因为该模块是用python内置urllib模块来下载数据的,需要提供有效的数据集网站地址。import tensorflow as tffrom tensorflow.examples.tutorials.mnist i...原创 2018-07-25 15:00:14 · 5266 阅读 · 0 评论 -
Tensorflow使用flags定义命令行参数详解
TensorFlow定义了tf.app.flags,用于支持接受命令行传递参数,相当于接受argv,详细用法请看代码中的注释例一:import tensorflow as tf##第一个是参数名称,第二个参数是默认值,第三个是参数描述tf.app.flags.DEFINE_string('str_name', 'def_v_1',"descrip1")tf.app.flags.DE...原创 2018-07-19 23:29:29 · 7099 阅读 · 0 评论 -
TensorFlow之tf.Session()和tf.InteractiveSession()的区别
1. tf.argmax() | tf.argmin()tf.argmax(input=tensor,dimention=axis) 找到给定的张量tensor中在指定轴axis上的最大值/最小值的位置。a=tf.get_variable(name='a', shape=[3,4], dtype=tf.floa...原创 2018-07-24 22:24:04 · 508 阅读 · 0 评论 -
Tensorflow之神经网络nn模块详解
Tensorflow中的tensorflow.nn模块是TensorFlow用于深度学习计算的核心模块。主要的API:激活函数(Activation Functions) 操作 描述 tf.nn.relu(features, name=None) 整流函数:max(features, 0) tf.nn.relu6(features, name=Non...原创 2018-07-18 23:41:00 · 12711 阅读 · 0 评论 -
TensorFlow模型载入方法汇总
一、TensorFlow常规模型加载方法保存模型加载模型不加载图结构,只加载参数加载图结构和参数简化版本二、TensorFlow二进制模型加载方法三、二进制模型制作四、从图上读取张量从二进制模型加载张量从当前图中获取对应张量从图中获取节点信息一、TensorFlow常规模型加载方法保存模型tf.train.Saver()类的save(sess, ckpt文...原创 2019-01-17 17:58:30 · 2320 阅读 · 1 评论