models icon indicating copy to clipboard operation
models copied to clipboard

Freeze graph errors

Open anne1994 opened this issue 9 years ago • 4 comments

When i try to run the freeze graph on the finetuned checkpoint i am getting the following errors. Traceback (most recent call last): File "freeze_graph.py", line 255, in app.run(main=main, argv=[sys.argv[0]] + unparsed) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run sys.exit(main(sys.argv[:1] + flags_passthrough)) File "freeze_graph.py", line 187, in main FLAGS.variable_names_blacklist) File "freeze_graph.py", line 179, in freeze_graph variable_names_blacklist) File "freeze_graph.py", line 116, in freeze_graph_with_def_protos variable_names_blacklist=variable_names_blacklist) TypeError: convert_variables_to_constants() got an unexpected keyword argument 'variable_names_blacklist'

I tried commenting variable_names_blacklist and then given the inputs --input_graph=/data/tmp/p-models-1/inception_v3/graph.pbtxt --input_checkpoint=/data/tmp/models-1/inception_v3/model.ckpt-1000 --output_graph=/data/tmp/frozen_graph.pb --output_node_names=InceptionV3/ AuxLogits/Logits/Predictions

i get Traceback (most recent call last): File "freeze_graph.py", line 255, in app.run(main=main, argv=[sys.argv[0]] + unparsed) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/app.py", line 43, in run sys.exit(main(sys.argv[:1] + flags_passthrough)) File "freeze_graph.py", line 187, in main FLAGS.variable_names_blacklist) File "freeze_graph.py", line 179, in freeze_graph variable_names_blacklist) File "freeze_graph.py", line 115, in freeze_graph_with_def_protos output_node_names.split(",")) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/graph_util_impl.py", line 234, in convert_variables_to_constants inference_graph = extract_sub_graph(input_graph_def, output_node_names) File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/graph_util_impl.py", line 158, in extract_sub_graph assert d in name_to_node_map, "%s is not in graph" % d AssertionError: softmax is not in graph

Any solutions?

anne1994 avatar Jul 11 '17 23:07 anne1994

@anne1994 try to change --output_node_names=InceptionV3/AuxLogits/Logits/Predictions by --output_node_names=InceptionV3/Logits/Predictions

chenyuZha avatar Jul 13 '17 10:07 chenyuZha

@chenyuZha I have finetuned on AuxLogits too.. I excluded scope for AuxLogits while training.

anne1994 avatar Jul 14 '17 18:07 anne1994

@anne1994 when you did your training, yes it needs exclude 2 scopes, but the output_node_names is just one scope.

chenyuZha avatar Jul 17 '17 12:07 chenyuZha

Hi There, We are checking to see if you still need help on this, as this seems to be considerably old issue. Please update this issue with the latest information, code snippet to reproduce your issue and error you are seeing. If we don't hear from you in the next 7 days, this issue will be closed automatically. If you don't need help on this issue any more, please consider closing this.

tensorflowbutler avatar Jan 29 '20 23:01 tensorflowbutler