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: 
Highlighted
Visitor lixun123
Visitor
648 Views
Registered: ‎09-29-2018

Crashed when running SSD(video_analysis)

Jump to solution

Hi!

      I trained my own model by following the steps provided by the link https://forums.xilinx.com/t5/Deephi-DNNDK/SSD-support-in-DNNC/td-p/896797# , and it can detect the target while running on the board. However, there is still a problem: it crashes frequently when running on the board, whether it is in the ZCU102 or the ZCU104.
      The size of the float.caffemodel I trained is 87.3MB, the output file of decent.sh (deplay.caffemodel) is also 87.3MB, and the output of dnnc.sh (dpu_ssd.elf) is 22.3MB, but the example provided by deephi The size of dpu_ssd.elf is only 743.6kB. I don't know if there is a problem in the process of decent or dnnc.
      When decent, my calibration data directly uses the training data (LMDB format, about 600 pictures), I don't know if the LMDB data can be used as calibration data in the process of decent。
      There are no detailed steps in the DNNK User Guide that make it impossible for me to correct my problems by myself. Figure 1 is my decent.sh, Figure 2 is dnnc.sh. My train_test.prototxt,deploy.prototxt(output of decent.sh),main.cc is also below.Can you give me some suggestions? Thank you very much!

1.png2.png

0 Kudos
1 Solution

Accepted Solutions
Xilinx Employee
Xilinx Employee
581 Views
Registered: ‎02-17-2011

Re: Crashed when running SSD(video_analysis)

Jump to solution

Hi @lixun123,

When you say "it is crashing", do you mean that the application is crashing when being run on the ZCU102 board?  If this is the case don't think this would be related to the quantization process.  Are there any error messages or seg faults?  It could be that you aren't dealing properly with the input images or you just have a bug in your software.  Is the input video that you feed to the network already scaled to the input size of the network? 

To answer your questions: the reduced size of the base Deephi dpu_ssd.elf model is because the SSD model has been pruned by about a factor of 10x which results in a model size reduction of about 10x.

For the decent quantize process, raw images are needed for calibration.  Generally you would use your test data set for this and you would add the paths to the calibration data in the input layer of the float.prototxt file.  You can use the LMDB file to run an auto_test after quantization and you would also specify this in a separate input layer and add the -auto_test option to your decent quantize command.  For SSD, this would look something like the following:

 

layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
include {
phase:TRAIN
}
transform_param {
crop_size: 300
mean_value: 104.0
mean_value: 117.0
mean_value: 123.0
resize_param {
prob: 1.0
resize_mode: WARP
height: 300
width: 300
interp_mode: LINEAR
interp_mode: AREA
interp_mode: NEAREST
interp_mode: CUBIC
interp_mode: LANCZOS4
}
}
image_data_param {
source: "./data/imagenet_320/calibration.txt"
root_folder:"./data/imagenet_320/calibration_images/"
batch_size: 10
shuffle: true
}
}
layer {
name: "data"
type: "AnnotatedData"
top: "data"
top: "label"
include {
phase: TEST
}
transform_param {
mean_value: 104.0
mean_value: 117.0
mean_value: 123.0
resize_param {
prob: 1.0
resize_mode: WARP
height: 300
width: 300
interp_mode: LINEAR
}
}
data_param {
source: "../examples/VOC0712/VOC0712_test_lmdb"
batch_size: 8
backend: LMDB
}
annotated_data_param {
batch_sampler {
}
label_map_file: "../data/VOC0712/labelmap_voc.prototxt"
}
}

 

Thanks and hope this helps,

JC

0 Kudos
3 Replies
Xilinx Employee
Xilinx Employee
582 Views
Registered: ‎02-17-2011

Re: Crashed when running SSD(video_analysis)

Jump to solution

Hi @lixun123,

When you say "it is crashing", do you mean that the application is crashing when being run on the ZCU102 board?  If this is the case don't think this would be related to the quantization process.  Are there any error messages or seg faults?  It could be that you aren't dealing properly with the input images or you just have a bug in your software.  Is the input video that you feed to the network already scaled to the input size of the network? 

To answer your questions: the reduced size of the base Deephi dpu_ssd.elf model is because the SSD model has been pruned by about a factor of 10x which results in a model size reduction of about 10x.

For the decent quantize process, raw images are needed for calibration.  Generally you would use your test data set for this and you would add the paths to the calibration data in the input layer of the float.prototxt file.  You can use the LMDB file to run an auto_test after quantization and you would also specify this in a separate input layer and add the -auto_test option to your decent quantize command.  For SSD, this would look something like the following:

 

layer {
name: "data"
type: "ImageData"
top: "data"
top: "label"
include {
phase:TRAIN
}
transform_param {
crop_size: 300
mean_value: 104.0
mean_value: 117.0
mean_value: 123.0
resize_param {
prob: 1.0
resize_mode: WARP
height: 300
width: 300
interp_mode: LINEAR
interp_mode: AREA
interp_mode: NEAREST
interp_mode: CUBIC
interp_mode: LANCZOS4
}
}
image_data_param {
source: "./data/imagenet_320/calibration.txt"
root_folder:"./data/imagenet_320/calibration_images/"
batch_size: 10
shuffle: true
}
}
layer {
name: "data"
type: "AnnotatedData"
top: "data"
top: "label"
include {
phase: TEST
}
transform_param {
mean_value: 104.0
mean_value: 117.0
mean_value: 123.0
resize_param {
prob: 1.0
resize_mode: WARP
height: 300
width: 300
interp_mode: LINEAR
}
}
data_param {
source: "../examples/VOC0712/VOC0712_test_lmdb"
batch_size: 8
backend: LMDB
}
annotated_data_param {
batch_sampler {
}
label_map_file: "../data/VOC0712/labelmap_voc.prototxt"
}
}

 

Thanks and hope this helps,

JC

0 Kudos
Visitor lixun123
Visitor
561 Views
Registered: ‎09-29-2018

Re: Crashed when running SSD(video_analysis)

Jump to solution

Thank you for your reply. I have solved my problem. I use six threads, four of which run SSD, which often crashes, but with only four threads, two of which run SSD without a problem.

0 Kudos
Xilinx Employee
Xilinx Employee
549 Views
Registered: ‎02-17-2011

Re: Crashed when running SSD(video_analysis)

Jump to solution

Great!  Glad to hear you were able to resolve this!

 

0 Kudos