aster
aster copied to clipboard
Which output node names to select for freezing the network
Can anyone tell which output node names can be selected in order to freeze the network?
output_graph_def = tf.graph_util.convert_variables_to_constants( sess, # The session is used to retrieve the weights tf.get_default_graph().as_graph_def(), # The graph_def is used to retrieve the nodes #output nodes for fetches ["Placeholder", "Postprocess/AggregateRecognitionResults/GatherNd","LocalizationNet/Reshape_1","Sampler/Reshape"]
Hi @nikita0511 thanks for your reply. I tried to give the output node names as you mentioned. Although it had to be given as "Postprocess/AggregateRecognitionResults/GatherNd,Placeholder,LocalizationNet/Reshape_1,Sampler/Reshape" because the argument has to be a string with comma seperated,
But once I use these nodes and freeze the network and later try to load the graph it raises an error :- "ValueError: No op named GatherTree in defined operations."
Could you share your thoughts on it? thanks in advance :)
Thank you for sharing the output nodes.
However, I'm encountering a problem. Those nodes are available when I open the checkpoint graph in tensorboard
but when I try to access them to freeze them, it says they don't exist.
How did you both have access to these nodes?
Edit: I realized that I wasn't viewing the actual .ckpt
model, but rather the properly configured evaluation model. To get around the node accessing problem, I had to replicate the set-up steps in demo.py
and eval.py
in my model freezing script.
@DeepanshuMakkar
I encountered the same error ValueError: No op named GatherTree in defined operations.
and another different one related to string operations after using this method.
I was able to get around it by importing /aster/builders/model_builder.py
and /aster/builders/input_reader_builder.py
.
I assume tf
doesn't know how to parse the .pb
without these being defined in the global scope. If either of you know why this happens or how we can get around it so we can simply use the .pb
as-is please let me know.
@DeepanshuMakkar @nikita0511 @dsandii Can you share the pb file if you have converted? Thanks in advance
@nikita0511
I am able to generate .pb file but when I try to load and run it on a image, I am getting this error
Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call return fn(*args) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1319, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/usr/local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1407, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: Invalid loop structure: Loop "Forward/Predictor/decoder/while/while_context" has more than one LoopCond node: {{node Forward/Predictor/decoder/while/LoopCond_1}} and {{node Forward/Predictor/decoder/while/LoopCond}}. This is an internal bug, please file a bug report with instructions on how to reproduce the error.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "create_tesorrt_model.py", line 119, in
Can you share the code snippet you used to generate .pb file?