In the original retrain.py:
bottleneck_input = tf.placeholder_with_default(
bottleneck_tensor, shape=[batch_size, bottleneck_tensor_size],
name='BottleneckInputPlaceholder')
Changed to:
bottleneck_input = tf.placeholder(
tf.float32, shape=[batch_size, bottleneck_tensor_size], name='BottleneckInputPlaceholder')
After training, check the parameters in retrained_graph.pb.
Utilize:
import tensorflow as tf
import os
model_name = 'retrained_graph.pb'
def create_graph():
with tf.gfile.FastGFile(os.path.join(model_name), 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
create_graph()
tensor_name_list = [tensor.name for tensor in tf.get_default_graph().as_graph_def().node]
for tensor_name in tensor_name_list:
print(tensor_name,'\n')
Before BOTTLENECK_TENSOR_NAME = 'pool_3/_reshape:0' was discovered, all the parameters were missing. Why?
In the original retrain.py:
bottleneck_input = tf.placeholder_with_default(
bottleneck_tensor, shape=[batch_size, bottleneck_tensor_size],
name='BottleneckInputPlaceholder')
Changed to:
bottleneck_input = tf.placeholder(
tf.float32, shape=[batch_size, bottleneck_tensor_size], name='BottleneckInputPlaceholder')
After training, check the parameters in retrained_graph.pb.
Utilize:
import tensorflow as tf
import os
model_name = 'retrained_graph.pb'
def create_graph():
with tf.gfile.FastGFile(os.path.join(model_name), 'rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
create_graph()
tensor_name_list = [tensor.name for tensor in tf.get_default_graph().as_graph_def().node]
for tensor_name in tensor_name_list:
print(tensor_name,'\n')
Before BOTTLENECK_TENSOR_NAME = 'pool_3/_reshape:0' was discovered, all the parameters were missing. Why?