cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jbond1007
Contributor
Contributor
587 Views
Registered: ‎08-02-2019

[DNNDK] Invalid pixel value of input tensor

Hi,

I have tensorflow model of Densenet. When I am running this on ZCU102, I get the following error:

[DNNDK] Invalid pixel value of input tensor: 19840
[DNNDK] Please check if decent tool produces correct quantization info.

I have checked the input image and the maximum pixel value in it was 221.

How could the DNNDK throw such error that the pixel value is 19840.

When I tried normalization by dividing with 255, it still says "Invalid pixel value: 128". When I print the Mat image all I could see are 1's and 0's.

Please Help!

0 Kudos
4 Replies
jasonwu
Moderator
Moderator
487 Views
Registered: ‎03-27-2013

Hi @jbond1007 ,

 

The input image pixel data need to be pre-processed before sending to DPU, you need to make sure that the pre-processing is just the same as when doing training, and also the input_scale value need to be multiplied to match the quantized network.

like code example here:

https://github.com/gewuek/flower_classification_dnndk_v2/blob/master/arm/flower_classification/src/main.cc

In this example the data is normalized in training, so it is done in ARM code.

Hope this can help.

Best Regards,
Jason
-----------------------------------------------------------------------------------------------
Please mark the Answer as "Accept as solution" if the information provided is helpful.

Give Kudos to a post which you think is helpful and reply oriented.
-----------------------------------------------------------------------------------------------
0 Kudos
ss9701
Observer
Observer
214 Views
Registered: ‎08-13-2020

Have you solved this problem? I also had this problem

0 Kudos
ss9701
Observer
Observer
181 Views
Registered: ‎08-13-2020

hello, I've done that, but it still prompts for errors.

[DNNDK] Invalid pixel value of input tensor: 5782

0 Kudos
ss9701
Observer
Observer
170 Views
Registered: ‎08-13-2020

My input_scale read from dnndk is 128, if I multiply 128 it will say: Invalid pixel value of input tensor: 5782.

But if I don't multiply the scale, it will say:  Invalid pixel value of input tensor: 128.

if I change the scale to 0.9999, it will become normal.

So I want to ask that if dnndk (vitis ai)  change the weight to +128 instead of +127 ?

This is my pre process:

捕获.PNG

0 Kudos