What's the output node names?
jasonhe88 opened this issue · 4 comments
jasonhe88 commented
I tried to convert model to frozen graph, but couldn't find the output names need in freee_graph tool
freeze_graph --input_saved_model_dir=saved_model --output_node_names= --output_graph=frozen_graph.pb
thanks a lot!
Steeeephen commented
Last layer is a dense layer, shooooould just be called dense
private-detector/private_detector/utils/effnetv2_model.py
Lines 569 to 572 in 32c04fa
>>> print(model.model.layers[-1].name)
dense
Does that work?
jasonhe88 commented
Thank you
it doesn't work out, here is the error message:
AssertionError: dense is not in graph
jasonhe88 commented
here is the script I used to do convert
from tensorflow.python.tools import freeze_graph
from tensorflow.python.saved_model import tag_constants
input_saved_model_dir = './saved_model'
output_node_names = 'dense'
input_binary = True
input_saver_def_path = False
restore_op_name = None
filename_tensor_name = None
clear_devices = False
input_meta_graph = False
checkpoint_path = './saved_checkpoint/ckpt-0.9375-14.data-00000-of-00001'
input_graph_filename = None
saved_model_tags = tag_constants.SERVING
output_graph_filename='frozen_graph.pb'
freeze_graph.freeze_graph(input_graph_filename,
input_saver_def_path,
input_binary,
checkpoint_path,
output_node_names,
restore_op_name,
filename_tensor_name,
output_graph_filename,
clear_devices,
"", "", "",
input_meta_graph,
input_saved_model_dir,
saved_model_tags)
Steeeephen commented
solved as per #7