UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor tacbook
Visitor
764 Views
Registered: ‎03-05-2019

How to define calibration.txt for ssd

Jump to solution

Dear all,


I am now trying to quantize my ssd model, but I don't know how to define calibration.txt for ssd.

( Generally ssd seems to need not only class number but also coordinates in image..)

Does anyone know how to do it ??


Thanks.

0 Kudos
1 Solution

Accepted Solutions
Visitor tacbook
Visitor
598 Views
Registered: ‎03-05-2019

Re: How to define calibration.txt for ssd

Jump to solution

Dear Ivalena,

Thank you sooo much for telling me in detail!!

As a result, I tried to deploy my ssd model step by step following by the tutorial you told me, and finally I successed to inference correctly on ZCU104!

My biggest mistake was the wrong number of "num_class"...

 

Again thank you very much for your great advice!

 

Best regards

 

0 Kudos
5 Replies
Xilinx Employee
Xilinx Employee
715 Views
Registered: ‎12-09-2015

Re: How to define calibration.txt for ssd

Jump to solution

Please see the ML-SSD-PASCAL-Caffe-Tutorial.

Capture.PNG

Click on float.prototxt to see where calibration.txt is located.

Capture.PNG

The path is relative to the DNNDK_Project directory

Capture.PNG

Follow the trail, and you'll find the calibration.txt file used in the tutorial.

Capture.PNG

Good luck!

 

Louie

Visitor tacbook
Visitor
708 Views
Registered: ‎03-05-2019

Re: How to define calibration.txt for ssd

Jump to solution

Dear Ivalena,

 

Thank u very much for replying me!!

In my recognition, decent tool needs calibration data to re-train model while quantizing(in order to keep accuracy), doesn't it?

So in case of SSD, it seems that we need to define not only class number but also object coordinate in calibration.txt.

But in the tutorial you told me, there are only class numbers of each image.

 

Is it enough to quantize by dnndk??

 

Best regards.

0 Kudos
Xilinx Employee
Xilinx Employee
693 Views
Registered: ‎12-09-2015

Re: How to define calibration.txt for ssd

Jump to solution

Quantization does not involve retraining (i.e., backpropagation). The generic process for quantization is described in this paper: Fixed Point Quantization of Deep Convolutional Networks. The general steps involve:

  • Runing several forward passes in floating point using the calibration dataset and recording the activation results
  • Creating a histogram of the weights and activations for each layer
  • Determining the maximum and minimum values from the histograms and selecting an appropriate mapping to fixed-point.

 

Thus, the calibration dataset needs to be "representative" of the actual data the neural network will encounter during deployment. For example, if the training dataset includes well-lit as well as poorly-lit images, but the calibration dataset only has well-lit images, then the resulting quantized model will be biased toward well-lit images and perform poorly when provided with dark images.

 

The format of the text file is defined by the ImageData layer.

Capture.PNG

 

 

 

 

 

Visitor tacbook
Visitor
599 Views
Registered: ‎03-05-2019

Re: How to define calibration.txt for ssd

Jump to solution

Dear Ivalena,

Thank you sooo much for telling me in detail!!

As a result, I tried to deploy my ssd model step by step following by the tutorial you told me, and finally I successed to inference correctly on ZCU104!

My biggest mistake was the wrong number of "num_class"...

 

Again thank you very much for your great advice!

 

Best regards

 

0 Kudos
Visitor zzc
Visitor
198 Views
Registered: ‎09-08-2019

Re: How to define calibration.txt for ssd

Jump to solution

how to define the number of num_class?

0 Kudos