
tensorflow
ycc_csdn
程序员进阶中
展开
-
批量读取tfrecord样本总数
def total_sample(file_path):tfrecords_list = []temp = os.listdir(file_path)# Get the path of tfrecord in a dirsample_nums = 0for tfrecord in temp:tfrecords_list.append(os.path.join(file_path, tf...原创 2019-07-14 17:13:21 · 535 阅读 · 0 评论 -
torch.mean和tf.reduce_mean
x = tf.constant([[0.3776],[0.3031],[0.4818],[0.3887]])y=tf.reduce_mean(x) # 1.5tf.reduce_mean(x, 0) # [1.5, 1.5]tf.reduce_mean(x, 1) # [1., 2.]with tf.Session() as sess:print(sess.run(y))...原创 2019-07-23 10:41:39 · 10750 阅读 · 0 评论