![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
tensorflow
糖糖糖-豆
chemistry_master
展开
-
tf.image.decode_jpeg(img).shape = (?,?,?)
tf.image.decode_jpeg(img).shape = (?,?,?)img_path = r'path/to/image'img_raw_data = tf.gfile.FastGFile(img_path,'rb').read()img_data = tf.image.decode_jpeg(img_raw_data)with tf.Session() as sess:...原创 2019-10-24 20:52:26 · 644 阅读 · 0 评论 -
tf.maximun(a,b)_tf.minimum(a,b)
tf.maximum:用法tf.maximum(a,b),返回的是a,b之间的最大值,tf.miniimum:用法tf.miiinimum(a,b),返回的是a,b之间的最小值,tf.argmax:用法tf.argmax(a,dimension),返回的是a中的某个维度最大值的索引,tf.argmain:用法tf.argmin(a,dimension),返回的是a中的某个维度最小值的索...转载 2018-05-21 21:05:23 · 10491 阅读 · 0 评论 -
tf.reshpe(a,[-1])_注意参数的-1的特殊
# tensor 't' is [1, 2, 3, 4, 5, 6, 7, 8, 9]# tensor 't' has shape [9]reshape(t, [3, 3]) ==> [[1, 2, 3], [4, 5, 6], [7, 8, 9]]# tensor 't' is [[[1...转载 2018-05-21 21:20:39 · 403 阅读 · 0 评论 -
tf.scatter_sub(ref, indices, updates)and tf.scatter_update(ref, indices, updates, use_locking = None
类似的 sub函数!ref = tf.Variable([1, 2, 3, 4, 5, 6, 7, 8],dtype = tf.int32)indices = tf.constant([4, 3, 1, 7],dtype = tf.int32)updates = tf.constant([9, 10, 11, 12],dtype = tf.int32)sub = tf.scatt...原创 2018-05-21 21:59:04 · 752 阅读 · 0 评论 -
tf.grather()
import tensorflow as tftemp = tf.range(0,10)*10 + tf.constant(1,shape=[10])temp2 = tf.gather(temp,[1,5,9])with tf.Session() as sess: print sess.run(temp) print sess.run(temp2)输出 [ 1...转载 2018-05-21 22:01:11 · 1282 阅读 · 0 评论 -
tf.control_dependencies()作用及用法
参考的博客:https://blog.csdn.net/PKU_Jade/article/details/73498753 在facenet .py的line 75-77 有引用该函数。with tf.control_dependencies([centers]): # 操作依赖,loss内的操作,将会再centers后再进行。 loss = tf.reduce_mean(t...转载 2018-05-23 17:14:02 · 1478 阅读 · 0 评论