1. 程式人生 > >人生中第一篇部落格——Tensorflow.hub模組的應用圖片分類的重訓練(源於文件原始碼)

人生中第一篇部落格——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)]

花索引