Tensorflow
xky1306102chenhong
这个作者很懒,什么都没留下…
展开
-
tensorflow编译及安装【tensorflow实战--笔记】
建议先安装Anaconda一。CPU版本安装 1.安装编译好的release版本 1)使用pip安装即可,或者conda 2.编译安装 1)安装gcc(4.8~5.4) 2)安装bazel(v0.43) 3)下载Tensorflow 1.0.0-rc0的源码 wget https://github.co原创 2017-11-16 11:46:24 · 924 阅读 · 0 评论 -
矩阵加法测试
# 矩阵加法测试import tensorflow as tfm = int(input())n = int(input())count = m * nA_list = []while count > 0: x_input = int(input()) A_list.append(x_input) count = count - 1A = tf.co...原创 2018-07-19 09:35:51 · 434 阅读 · 0 评论 -
numpy的尝试
原创 2018-07-20 09:18:04 · 134 阅读 · 0 评论 -
Tensorflow: Math变量初始化
# Tensorflow: Math变量初始化import tensorflow as tf# Method 1:# 1. 使用xxxx()方法生成一个Tensor# 2. 将这个Tensor作为tf.Variable()中的initial_value参数的入参, 来初始化这个变量A = tf.Variable(tf.truncated_normal([2, 2], mean=0.0...原创 2018-07-20 14:11:30 · 144 阅读 · 0 评论 -
Tensorflow指定GPU的指定和显存设置
查看机器上GPU情况命令: nvidia-smi功能:显示机器上gpu的情况 命令: nvidia-smi -l功能:定时更新显示机器上gpu的情况其中左上侧有0、1、2、3的编号,表示GPU的编号,在后面指定GPU时需要使用这个编号。 在终端执行程序时指定GPU CUDA_VISIBLE_DEVICES=1 python your_file.py...转载 2018-07-31 10:08:09 · 4259 阅读 · 0 评论 -
Linux服务器没有GUI的情况下使用matplotlib绘图
import matplotlib as mpl mpl.use('Agg') #而且必须添加在import matplotlib.pyplot之前,否则无效 #最后在plt.draw后面加上plt.savefig("/home/yourname/picFaster.jpg")#就可以把绘制的图存为jpg,down到本地查看就行了 ...转载 2018-07-31 10:13:55 · 472 阅读 · 0 评论 -
tf.app.run()的使用
import tensorflow as tfprint("aaaa")def main(_): print("bbb")if __name__ == '__main__': tf.app.run()# aaaa# bbb原创 2018-07-31 16:59:19 · 776 阅读 · 0 评论 -
查看模型保存的有name参数
# checkpoint_dir下有四个files:meta, index, data, checkpointcheckpoint_dir = './save/checkpoint'reader = tf.train.NewCheckPointReader(checkpoint_dir+'/model-init')variables = reader.get_variable_to_sh...原创 2018-08-14 13:31:11 · 320 阅读 · 0 评论 -
tf.nn.conv2d()
源码:def conv2d(input, filter, strides, padding, use_cudnn_on_gpu=True, data_format="NHWC", dilations=[1, 1, 1, 1], name=None): r"""Computes a 2-D convolution given 4-D `input` and `filter` tensors...原创 2018-08-03 10:48:26 · 1050 阅读 · 0 评论 -
TensorFlow保存,加载模型
1. 保存模型:# -*- coding: UTF-8 -*-import tensorflow as tfimport osos.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'W1 = tf.Variable(tf.random_normal([2]), name='w1')W2 = tf.Variable(tf.constant(1, shape...原创 2018-08-12 20:15:22 · 205 阅读 · 0 评论 -
实现Ax+b【tensorflow】
注意:型一致代码:import tensorflow as tfm = int(input())n = int(input())count = m * nA_list = []while count > 0: x_input = int(input()) A_list.append(x_input) count = count - 1A = t...原创 2018-07-19 09:15:13 · 667 阅读 · 0 评论 -
从键盘输入一个m*n的二维张量【tensorflow】
代码:# 从键盘输入一个二维张量import tensorflow as tfsess = tf.InteractiveSession()m = int(input()) # 输入一个数m,需强制类型转换n = int(input())count = m * nA_list = []while count > 0: x_input = int(input()...原创 2018-07-19 08:07:41 · 1059 阅读 · 0 评论 -
实现输入字符串输出字符串【tensorflow】
ctrl+alt+L可以格式化代码问题:输入str,然后输出str思路:1. 开启一个sess 2. 循环:每次申请一个占位符,初始化操作;执行初始化,输入变量,执行变量;输出变量 3. 关闭sess代码:import tensorflow as tfsess = tf.InteractiveSession() # 开启一个s...原创 2018-07-18 22:13:47 · 2537 阅读 · 0 评论 -
TensorFlow架构与设计:会话生命周期
作者:刘光聪 中兴通讯高级系统架构师,专注机器学习算法,分布式系统架构与优化。 原文: TensorFlow架构与设计:会话生命周期-----------------------------------------------------------------------------------------------------------------------转载 2017-12-03 18:25:49 · 294 阅读 · 0 评论 -
TensorFlow Python API解析:图的核心数据结构
转自http://blog.csdn.net/deepknower/article/details/53824653本文默认的一些名称叫法: 1. “Tensor实例”、”Tensor对象”、”tensor”都是在说一个Tensor实例。同样,”Operation实例”、”Operation对象”、”operation”都是在说一个Operation实例。2. 单独的”Tens转载 2017-12-04 17:04:49 · 372 阅读 · 0 评论 -
TensorFlow架构与设计:OP本质论
转自http://www.jianshu.com/p/236335897b30TensorFlow的系统结构以C API为界,将整个系统分为「前端」和「后端」两个子系统。前端系统扮演了Client的角色,完成计算图的构造,通过转发Protobuf格式的GraphDef给后端系统的Master,并启动计算图的执行过程。最终,Master将图进行分裂,通过RegisterGraph接口,将Gra转载 2017-12-03 21:07:18 · 221 阅读 · 0 评论 -
Tensorflow项目构建流程
参考博客http://blog.csdn.net/hjimce/article/details/51899683 整理一。训练阶段 1.tensorflow打包数据 1)在线读取,通过placeholder变量,把数据送入网络,进行计算(效率低) 2)采用tfrecoder进行高效数据读取 2.网络架构与训练 经过上面的原创 2017-11-25 20:29:05 · 886 阅读 · 0 评论 -
Tensorflow的client里的session.py模块
session.py-------"""A client interface for TensorFlow."""object->SessionInterface->BaseSession->Sessionobject->SessionInterface->BaseSession->InteractiveSessionSession和InteractiveSession里没有run()原创 2018-01-15 17:10:50 · 1048 阅读 · 0 评论 -
机器学习学习链接
tensorflow API :https://wenku.baidu.com/view/6158f2ae951ea76e58fafab069dc5022aaea46a6.html?from=search香港科大ppt和github:https://wenku.baidu.com/view/f59fba5ceef9aef8941ea76e58fafab068dc4453.html?from=s原创 2018-01-15 21:46:22 · 290 阅读 · 0 评论 -
epoch, batch_size,iteration
In the neural network terminology:one epoch = one forward pass and one backward pass of all the training examplesbatch size = the number of training examples in one forward/backward pass. The high转载 2018-01-16 02:02:03 · 240 阅读 · 0 评论 -
CAAE网络学习
"""CAAE网络的encoder部分"""def encoder(self, image, reuse_variables=False): if reuse_variables: tf.get_variable_scope().reuse_variables() num_layers = int(np.log2(self.size_image)) - int(self.size...原创 2018-08-08 03:13:37 · 1100 阅读 · 0 评论