Description
We are trying to run Inference on a custom trained MobileNetV2 SSD, but when we invoke
SampleUniquePtr<IHostMemory> plan{builder->buildSerializedNetwork(*network, *config)};
on our model.uff we face this error:
Assertion numPriors * numLocClasses * 4 == inputDims[param.inputOrder[0]].d[0]’ failed.`
Our model is trained with TF 1.15 and these are the parameters:
width: 512
height: 288
channels: 3
alpha: 1.4
After the train we exported the frozen graph:
python object_detection/export_inference_graph.py \
--input_type=image_tensor \
--pipeline_config_path=pipeline.config \
--output_directory=out_dir/ \
--trained_checkpoint_prefix=model.ckpt-4000
and then we obtained .uff model using build_engine.py with these parameters:
Input = gs.create_plugin_node(
name='Input',
op='Placeholder',
shape=(1,) + (3, 288, 512)
)
PriorBox = gs.create_plugin_node(
name='MultipleGridAnchorGenerator',
op='GridAnchor_TRT',
minSize=0.2,
maxSize=0.9,
aspectRatios=[1.0, 2.0, 0.5, 3.0, 0.33],
variance=[0.1, 0.1, 0.2, 0.2],
featureMapShapes=[32, 16, 8, 4, 2, 1],
numLayers=6
)
NMS = gs.create_plugin_node(
name='NMS',
op='NMS_TRT',
shareLocation=1,
varianceEncodedInTarget=0,
backgroundLabelId=0,
confidenceThreshold=0.3,
nmsThreshold=0.6,
topK=100,
keepTopK=100,
numClasses=8
inputOrder=inputOrder,
confSigmoid=1,
isNormalized=1
)
NOTE: If we train a squared input network (512x512x3) there are no issue performing inference