davidsandberg / facenet

Face recognition using Tensorflow
MIT License
13.75k stars 4.81k forks source link

NAME of INPUT and OUTPUT nodes? #1160

Open adarshksudarsan opened 4 years ago

adarshksudarsan commented 4 years ago

Can you provide the name of INPUT and OUTPUT nodes for the model 20170512-110547 and also the dimensions of input image used for training.

FrancPS commented 4 years ago

+1

20180402-114759

meetpatel5720 commented 4 years ago

This may help you to print inputs and outputs of the model.

def load_model(path):
    print('Model filename: %s' % path)
    with gfile.FastGFile(path, 'rb') as f:
        graph_def = tf.GraphDef()
        graph_def.ParseFromString(f.read())
    with tf.Graph().as_default() as graph:
        tf.import_graph_def(graph_def)
        ops = graph.get_operations()
        outputs_set = set(ops)
        inputs = []
        for op in ops:
            if len(op.inputs) == 0 and op.type != 'Const':
                inputs.append(op)
            else:
                for input_tensor in op.inputs:
                    if input_tensor.op in outputs_set:
                        outputs_set.remove(input_tensor.op)
        outputs = list(outputs_set)
        print(outputs)
        print(inputs)