No result when using tensorRT Sample FasterRCNN with other images

Hi,

when I using the tensorRT FasterRCNN sample

with the image offered by github in dusty-nv/jetson-inference

ex: jetson-inference/dog_2.jpg at master · dusty-nv/jetson-inference · GitHub

and other images, there are no detection results even though I lower the threshold

“nms_threshold” and “score_threshold”. I have revised the code to load .jpg and

it works when loading images in sample faster-rcnn folder transformed to .jpg from .ppm

Hi,

In FasterRCNN sample, we extract image data via function ‘readPPMFile’.
readPPMFile is a simple parser for the uncompressed image format. It can’t read a .jpg file, and the output will be incorrect.

For jpg decoder, you can check this sample.
[url]https://github.com/dusty-nv/jetson-inference/blob/master/imagenet-console/imagenet-console.cpp#L68[/url]

Thanks.

Thx!

And another question,

can we adjust OutputDimension in stage enqueue?

like in caffe, we can reshape top blob in stage Forward_cpu after LayerSetup.

Am I right to seem getOutputDimensions() and initialize() as LayerSetup in caffe

and enqueue as Forward_cpu in caffe?

Hi,

No.

When creating the TensorRT engine, the output dimension is chosen for optimized performance.
TensorRT doesn’t support the dimension change on the fly. Sorry for the inconvenience.

ok!

I load trained model but it break:

[libprotobuf FATAL …/…/…/externals/protobuf/aarch64/10.0/include/google/protobuf/repeated_field.h:1078] CHECK failed: (index) < (current_size_):
terminate called after throwing an instance of ‘google_private::protobuf::FatalException’
what(): CHECK failed: (index) < (current_size_)

I have refered https://devtalk.nvidia.com/default/topic/1004468/how-to-start-tensorrt-on-tx1-/

but it still doesn’t work.

what kind of problem may it happened?

Hi,

Which Caffe version do you use for training?
Please remember that TensorRT2.1 only support nvcaffe-0.15 branch.

NvCaffe-0.16 may lead to error.
Thanks.

I train by using BVLC/caffe(version:1.0.0-rc3) instead of using DIGITS.

Does it affect?

Should I retrain my model by nvcaffe-0.15 instead?

Hi,

Do you use TensorRT1.0?
Could you try to use TensorRT2.1 with JetPack3.1?

Thanks.

No,

I use TensorRT2.1

Hi,

Could you share prototxt and caffemodel?

Hi,

I revise

“==========================”
input: “im_info”
input_shape {
dim: 1
dim: 3
}
“==========================”

to

“==========================”
input: “im_info”
input_shape {
dim: 1
dim: 1
dim: 1
dim: 3
}
“==========================”

in protofile, and it works, why it works after revised?

(note: it breaks in “Begin parsing model…” before revised)

Hi,

They have different meaning:

input_shape {
dim: 1 ← BATCHSIZE
dim: 1 ← channel
dim: 1 ← height
dim: 3 ← widith
}

Please check this tutorial for more information:
http://caffe.berkeleyvision.org/tutorial/net_layer_blob.html

Hi,

I face another problem

“================================================================”
Begin building engine…

res5a: all elementwise inputs must have same dimensions
res5b: all elementwise inputs must have same dimensions
res5c: all elementwise inputs must have same dimensions
“================================================================”

I remember tensorRT2 support elementwise, but why this message appear?

Hi,

From the error message, your elementwise has different dimensions.
Elementwise need two identical dimension input. Could you recheck it?

Ok, I will recheck it thx!

When implement getOutputDimensions(int index, const Dims* inputs, int nbInputDims)

what is nbInputDims exactly?

and inputs[0].d[0],inputs[0].d[1],inputs[0].d[2],inputs[0].d[3] are always (N,C,H,W)?

If not, how to get N of (N,C,H,W)?

I have the same problem.

And this is due to the data shape defined in prototxt.

input_shape {
dim: 1
dim: 3
dim: 375
dim: 500
}

the dim has to fit the height and width of the input image.

in the original faster rcnn, I can pass any resolution by reshape input layer before forwarding.

Can I reshape the input shape in TensorRT?

Hi,

It looks like this issue is from your model design.
You can check it via DIGITs or other visualized frameworks.

Dimension of C, H, W can get by getOutputDimensions(…)
[url]Face-Recognition/pluginImplement.cpp at master · AastaNV/Face-Recognition · GitHub

getNbOutputs() is return the number of output blobs, rather than the dimension.

Thanks.

Hi,

so if in getOutputDimensions, we just return DimsNCHW

and in its next layer, we can get

inputs[0].d[0], inputs[0].d[1], inputs[0].d[2], inputs[0].d[3] for (N,C,H,W) right?

and DimsHW in its next layer, we can get

inputs[0].d[0], inputs[0].d[1] for (H,W) right?

Hi,

Only C, H, W information is available.

In plugin API, user doesn’t need to take care of BatchSize handling.
The operation will be applied to all the batch data automatically.

Thanks.

Hi,

====================
reshape_param {
shape {
dim: 300
dim: 5
}
}

so in such reshape param

we just return DimsCHW(300,5,1) or DimsCHW(1,300,5)??