PRBonn / bonnet

Bonnet: An Open-Source Training and Deployment Framework for Semantic Segmentation in Robotics.
GNU General Public License v3.0
323 stars 89 forks source link

input_norm_and_resized_node vs input_node #47

Closed JadBatmobile closed 5 years ago

JadBatmobile commented 5 years ago

Hello,

I am curious what the difference between the input_node and the input_norm_and_resized_node are?

I see in deploy_cpp that netTF.cpp utilizes input_node, and netTRT.cpp utilizes input_norm_and_resized_node.

JadBatmobile commented 5 years ago

i see that one is raw image, and the other is resized and normalized, but why is it necessary that TRT accepts the processed version, and TF the raw version?

tano297 commented 5 years ago

Unfortunately some of the operators between the input and the norm_resized version are not supported by tensorRT. At least at the time that I built the inference pipeline. If you want to try to change that and it works with newer tensorRT versions, I'm more than happy accepting a pull request :)

JadBatmobile commented 5 years ago

I understand, which tensorRT version are you using? it is not specified in the README

JadBatmobile commented 5 years ago

Also, in bonnet.py, lines 52 - 62, i see img_pl being resized with tf.image.resize_images, then transposed with tf.transpose, then normalized with a regular python subtraction and division ( - 128 / 128 ). Do you recall which of those operations specifically was not running in TensorRT?

tano297 commented 5 years ago

It was definitely the resizing. And in older versions of tensorRT also division was a problem given some nomenclature and API problems. The division seems to be supported in tensorRT5, but resizing I don't think. In my computer I'm currently running tensorRT3 and in my jetson AGX tensorRT5, and it's working for both in the current state

JadBatmobile commented 5 years ago

Okay, thank you for the speedy responses