Hi,
Thanks for your patience.
We can run your model with the following change. Please give it a try.
1. Convert .pb file into .uff with following config.py
import graphsurgeon as gs
import tensorflow as tf
Input = gs.create_node("Input",
op="Placeholder",
dtype=tf.float32,
shape=[1, 3, 300, 300])
PriorBox = gs.create_plugin_node(name="GridAnchor", op="GridAnchor_TRT",
numLayers=6,
minSize=0.2,
maxSize=0.95,
aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
variance=[0.1,0.1,0.2,0.2],
featureMapShapes=[19, 10, 5, 3, 2, 1])
NMS = gs.create_plugin_node(name="NMS", op="NMS_TRT",
shareLocation=1,
varianceEncodedInTarget=0,
backgroundLabelId=0,
confidenceThreshold=1e-8,
nmsThreshold=0.6,
topK=100,
keepTopK=100,
numClasses=2,
inputOrder=[0, 2, 1],
confSigmoid=1,
isNormalized=1,
scoreConverter="SIGMOID")
concat_priorbox = gs.create_node(name="concat_priorbox", op="ConcatV2", dtype=tf.float32, axis=2)
concat_box_loc = gs.create_plugin_node("concat_box_loc", op="FlattenConcat_TRT", dtype=tf.float32, axis=1, ignoreBatch=0)
concat_box_conf = gs.create_plugin_node("concat_box_conf", op="FlattenConcat_TRT", dtype=tf.float32, axis=1, ignoreBatch=0)
namespace_plugin_map = {
"MultipleGridAnchorGenerator": PriorBox,
"Postprocessor": NMS,
"Preprocessor": Input,
"ToFloat": Input,
"image_tensor": Input,
"Concatenate": concat_priorbox,
"concat": concat_box_loc,
"concat_1": concat_box_conf
}
def preprocess(dynamic_graph):
# Now create a new graph by collapsing namespaces
dynamic_graph.collapse_namespaces(namespace_plugin_map)
# Remove the outputs, so we just have a single output node (NMS).
dynamic_graph.remove(dynamic_graph.graph_outputs, remove_exclusive_dependencies=False)
dynamic_graph.find_nodes_by_op("NMS_TRT")[0].input.remove("Input")
2. Apply following change in /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_SSD
diff --git a/sources/objectDetector_SSD/config_infer_primary_ssd.txt b/sources/objectDetector_SSD/config_infer_primary_ssd.txt
index bafdff7..089ac89 100755
--- a/sources/objectDetector_SSD/config_infer_primary_ssd.txt
+++ b/sources/objectDetector_SSD/config_infer_primary_ssd.txt
@@ -64,13 +64,13 @@ offsets=127.5;127.5;127.5
model-color-format=0
model-engine-file=sample_ssd_relu6.uff_b1_fp32.engine
labelfile-path=ssd_coco_labels.txt
-uff-file=sample_ssd_relu6.uff
+uff-file=///home/nvidia/topic_1067003/topic_1067003.uff
uff-input-dims=3;300;300;0
uff-input-blob-name=Input
batch-size=1
## 0=FP32, 1=INT8, 2=FP16 mode
network-mode=0
-num-detected-classes=91
+num-detected-classes=2
interval=0
gie-unique-id=1
is-classifier=0
3. Run
$ cd /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_SSD
$ cp /usr/src/tensorrt/data/ssd/ssd_coco_labels.txt .
$ export CUDA_VER=10.0
$ make -C nvdsinfer_custom_impl_ssd
$ deepstream-app -c deepstream_app_config_ssd.txt
Thanks and please let us know your result.