-
Notifications
You must be signed in to change notification settings - Fork 173
Open
Description
Hello, I try to convert the pb model to tensorflow.js model, but I encountered some problem. I follow the official tutorial to convert model over here. The first difficulty is to find the output_node_names, I used the codes as follows to solve this problem.
with tf.gfile.FastGFile('./model/mobile_facenet.pb','rb') as f:
graph_def = tf.GraphDef()
graph_def.ParseFromString(f.read())
tf.import_graph_def(graph_def, name='mobile_facenet')
tensor_name_list = [tensor.name for tensor in tf.get_default_graph().as_graph_def().node]
print(tensor_name_list[-1])
Then, I got ''embeddings'', so the output node name should be ''embeddings''.
Therefore, I use the command as follows to convert this pb model
!tensorflowjs_converter --input_format=tf_frozen_model --output_node_names='embeddings' ./model/mobile_facenet.pb ./model/web_model
Unfortunately, I got error as follows:
KeyError: 'The name "'embeddings'" refers to an Operation not in the graph.'
I do not know how to solve this problem. Please help me, thank you!
Metadata
Metadata
Assignees
Labels
No labels