jkjung-avt / tensorrt_demos

TensorRT MODNet, YOLOv4, YOLOv3, SSD, MTCNN, and GoogLeNet
https://jkjung-avt.github.io/
MIT License
1.75k stars 547 forks source link

Issues convert ssdlite_mobilenet_v2_coco to TensorRT engine #405

Closed SokPhanith closed 3 years ago

SokPhanith commented 3 years ago

Jetson nano 4GB Jetpack-4.5.1 image

Hello @jkjung-avt . I try to convert ssdlite_mobilenet_v2_coco with frozen_inference_graph.pb rename it with ssdlite_mobilenet_v2_coco.pb and then run with : python3 build_engine.py ssdlite_mobilenet_v2_coco I got something like that :

python3 build_engine.py ssdlite_mobilenet_v2_coco
2021-05-08 02:48:41.243494: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.10.2
WARNING:tensorflow:Deprecation warnings have been disabled. Set TF_ENABLE_DEPRECATION_WARNINGS=1 to re-enable them.
NOTE: UFF has been tested with TensorFlow 1.15.0.
WARNING: The version of TensorFlow installed on this system is not guaranteed to work with UFF.
UFF Version 0.6.9
=== Automatically deduced input nodes ===
[name: "Input"
op: "Placeholder"
attr {
  key: "dtype"
  value {
    type: DT_FLOAT
  }
}
attr {
  key: "shape"
  value {
    shape {
      dim {
        size: 1
      }
      dim {
        size: 3
      }
      dim {
        size: 300
      }
      dim {
        size: 300
      }
    }
  }
}
]
=========================================

Using output node NMS
Converting to UFF graph
Warning: No conversion function registered for layer: NMS_TRT yet.
Converting NMS as custom op: NMS_TRT
WARNING:tensorflow:From /usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py:226: The name tf.AttrValue is deprecated. Please use tf.compat.v1.AttrValue instead.

Warning: No conversion function registered for layer: FlattenConcat_TRT yet.
Converting concat_box_conf as custom op: FlattenConcat_TRT
Warning: No conversion function registered for layer: FlattenConcat_TRT yet.
Converting concat_box_loc as custom op: FlattenConcat_TRT
DEBUG [/usr/lib/python3.6/dist-packages/uff/converters/tensorflow/converter.py:143] Marking ['NMS'] as outputs
No. nodes: 589
UFF Output written to /home/phanith/project/tensorrt_demos/ssd/ssdlite_mobilenet_v2_coco.uff
UFF Text Output written to /home/phanith/project/tensorrt_demos/ssd/ssdlite_mobilenet_v2_coco.pbtxt
#assertionnmsPlugin.cpp,82
Aborted (core dumped)
jkjung-avt commented 3 years ago

Refer to: https://forums.developer.nvidia.com/t/ssdlite-mobilenetv2-cant-convert-to-tensorrt-engine/142049

The root cause seems to be changes in the SSD Grid Anchor Generator. You probably need to use UFF graphsurgeon to modify the graph to make it work.