![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
文章平均质量分 58
Hanx_22
这个作者很懒,什么都没留下…
展开
-
用tensorflow创建文件目录以及删除目录下所有内容
#coding=utf-8import tensorflow as tftf.app.flags.DEFINE_string('checkpoint_path', 'E:/E/test/src/checkpoint', '')tf.app.flags.DEFINE_boolean('restore', False, 'whether to resotre from checkpoint')原创 2017-08-16 15:30:37 · 1674 阅读 · 1 评论 -
从collection中取op
#coding=utf-8import tensorflow as tfwith tf.name_scope("hello") as name_scope: arr1 = tf.get_variable("arr1", shape=[2,10],dtype=tf.float32) a = tf.Variable(0,name='a')arr2 = tf.get_varia原创 2017-08-16 17:10:10 · 348 阅读 · 0 评论 -
建立与读取.pb文件
#coding=utf-8import tensorflow as tffrom tensorflow.python.framework import graph_utilx = tf.placeholder(shape=[1], dtype=tf.float32, name='x')varibale_1 = tf.get_variable('v1', [1], tf.float32,原创 2017-08-16 21:58:17 · 5976 阅读 · 0 评论 -
存储与读取变量
1.存储模型并且指定存储的变量#coding=utf-8import tensorflow as tfx = tf.placeholder(shape=[1], dtype=tf.float32, name='xx')variable_0 = tf.get_variable('v0', [1], tf.float32, initializer=tf.random_normal_ini原创 2017-08-16 22:29:41 · 299 阅读 · 0 评论 -
关于多gpu测试的疑问
1.首先保存模型以及值:import tensorflow as tfinput = tf.placeholder(tf.float32, [], 'input')with tf.name_scope('hans'): weights = tf.get_variable('weights', [], tf.float32, tf.ones_initializer(tf.floa原创 2017-08-19 00:02:47 · 781 阅读 · 0 评论 -
tensorflow学习1
1.图的创建与选择import tensorflow as tfg1 = tf.Graph()with g1.as_default(): v = tf.get_variable("v", [1], initializer = tf.zeros_initializer()) # 设置初始值为0g2 = tf.Graph()with g2.as_default():转载 2017-07-28 22:02:38 · 203 阅读 · 0 评论 -
pure seq2seq
1.pure seq2seqenc_inputs = tf.placeholder( tf.int32, shape=[None, enc_sentence_length], name='input_sentences') #enc_sentence_length:为encoder端的time_setp数sequence_lengths = t原创 2017-08-31 14:50:14 · 328 阅读 · 0 评论 -
rnn decoder
1.rnn_decoderdef _extract_argmax_and_embed(embedding, output_projection=None, update_embedding=True): """Get a loop_function that extrac原创 2017-08-31 15:18:53 · 1038 阅读 · 0 评论