Skip to content

about bottleneck_input = tf.placeholder_with_default ? #21

Description

@mymuli

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions