I am trying to convert fastercnn incpetion coco v2model to tensort engine,and get follwoing error
while conversion to uff for loading in c++ subsequently,
File “uff_model.py”, line 43, in
x = TRT_Model("/home/user/faster_rcnn_inception_v2_coco_2018_01_28/frozen_inference_graph.pb",[‘detection_boxes’, ‘detection_scores’, ‘detection_classes’]).toUff()
File “uff_model.py”, line 21, in toUff
model_uff = uff.from_tensorflow_frozen_model(self.path_to_frozen_graph,self.outputnames)
File “/home/user/anaconda3/envs/tensorflow-gpu/lib/python3.5/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 149, in from_tensorflow_frozen_model
return from_tensorflow(graphdef, output_nodes, preprocessor, **kwargs)
File “/home/user/anaconda3/envs/tensorflow-gpu/lib/python3.5/site-packages/uff/converters/tensorflow/conversion_helpers.py”, line 120, in from_tensorflow
File “/home/user/anaconda3/envs/tensorflow-gpu/lib/python3.5/site-packages/uff/converters/tensorflow/converter.py”, line 79, in convert_tf2uff_graph
File “/home/user/anaconda3/envs/tensorflow-gpu/lib/python3.5/site-packages/uff/converters/tensorflow/converter.py”, line 53, in convert_tf2uff_node
raise UffException(str(name) + " was not found in the graph. Please use the -l option to list nodes in the graph.")
uff.model.exceptions.UffException: detection_classes was not found in the graph. Please use the -l option to list nodes in the graph.
The graph is used in object detection for python and has the nodes.can you please help reolve the issue.
The log indicates there is no 'detection_classes ’ layer inside your model.
Maybe you can check if there is any prefix name on it. or use the -l option to dump the nodes in your model?
Its there acfually, i am using standard faster rcnn inception v2 coco graph downloaded from TF Object detection Zoo.
The same graph is being used by my tf serving to serve the models with above nodes.I have tried all the combinations such as detection_classes:0,detection_classes,import/detection_classes forward but still not working!
Is this the case with all TF Object dtection models,do you have any engine already created and code for creating TF model zoo to engine for serving.
can you share the model you are using (or the link to the one you are referencing)? and the C++ code used to convert to uff ? It’d help us debug
I am not using C++ code,as menyiined in your docs, tf frozen graph is to be converted to uff model before further engine creation steps.So i am using Pythons uff api uff.fromtensorflow_frozen_graph() function and thats is thrwoing above exception.
Model can be found in here-
https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md with name faster_rcnn_inception_coco_v2
The fasterRCNN model is complex and will not work out of the box with TensorRT. It will require a lot of pre-processing to make the model work, as it contains a lot of unsupported nodes.
Are you any preprocessing using graphsurgeon? If so, it could be possible that the detection_classes node is getting removed/modified in the process. If not familiar with graphsurgeon, please reference the uff_ssd sample.
I am facing a similar problem. I am trying to use TensorRT on Windows 10. After looking into the documentation and other similar posts, this is the workflow I am trying :
Step 1 : Load trained .pb file, remove only training nodes and convert variables to constants.
Step 2 : On a Linux machine, use TensorRT Python UFF api to convert output of step one (a .pb file or graphdf) to UFF format.
Step 3 : Use UFF formant file on Windows 10 in order to create TensorRT engine.
Let me know if this is not the correct workflow for using TensorRT for FasterRCNN on Windows 10.
Pursuing this, I am stuck on step 2 :
uff_model = uff.from_tensorflow(frozen_graph_filename, [“detection_scores”])
uff.model.exceptions.UffException: detection_scores was not found in the graph. Please use the -l option to list nodes in the graph.
Any help is appreciated.
Thanks in advance.
Yes it is getting removed in the process I have checked it,can you tell me why GS removes the node and maybe it should also print out the nodes that are getting removed,What is the workaround to make FasterRCNN works.
I would appreciate if you can elaborate on “lot of preprocessing” as preprocessing doesnt mean removing core nodes from the graph.
Did you by any chance find the workaround for fastercnn incpetion coco v2 model ??