人生中第一篇博客——Tensorflow.hub模块的应用图片分类的重训练(源于文档源码)

1. tf.gfile.LIstDirectory(filename)

返回文件夹(filename)的列表,类似于listdir,子文件夹只会返回文件夹名。

2. tf.image.decode_jpeg(jpeg_data,channels = depth)

jpeg_data = tf.placeholder(tf.string,name=''),将图片数据转化为tensor

3. tf.stack(values,axis = 0,name'stack')

组合为tensor,加一维

4. tf.cast(x,dtype)

转换tensor类型

5.tf.image.resize_bilinear(tensro_4d,resize_shape)

注意该函数必须是4维张量,可以通过expand_dims()和squeeze

6.tf.argmax(outputs,1)

返回最大索引

7. Tensor.eval(session = sess)

返回对应的np.array()

8. out_classes[prediction.eval(session = sess)]

花索引

猜你喜欢

转载自blog.csdn.net/hunt_ing/article/details/80099616