Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6403 Discussions

Mobilenet-ssd caffe model gives NaN as output

idata
Employee
1,090 Views

Hi everyone, I am using mobilenet-ssd caffe model for detection. Using caffemodel and prototxt file from here : https://github.com/chuanqi305/MobileNet-SSD

 

Using the caffemodel and prototxt I was able to generate graph file without any error using mvNCCompile

 

But whenever I load my output after detection I see NAN in the output.

 

input_image = cv2.resize(input_image,(300,300), cv2.INTER_LINEAR) display_image = input_image height_crop = display_image.shape[0] width_crop = display_image.shape[1] input_image = input_image.astype(np.float32) input_image = np.subtract(input_image,127.5) input_image = np.multiply(input_image,0.007843) input_image = input_image.astype(np.float32) graph.LoadTensor(input_image, 'user object') out, userobj = graph.GetResult()

 

Any directions are appreciated , thank you .

0 Kudos
12 Replies
idata
Employee
740 Views

@hrsht.sarma I'm attempting to reproduce your issue, but I was unable to generate the graph file from the links you provided. Did you modify the prototxt file in any way? I tried removing the training and data layers but this did not work for me. If you performed any special steps, please let me know and I will try it again. Thanks.

0 Kudos
idata
Employee
740 Views

@Tome_at_Intel isn't mobilenet-ssd supported in current release? I even can not compile the graph file.

0 Kudos
idata
Employee
740 Views

I have following files :

 

prototxt: https://drive.google.com/file/d/1O11sw2AvG4RlG_JnzQSFodT9WTH7PKaQ/view?usp=sharing

 

caffemodel : https://drive.google.com/file/d/1d4Bfey6knTGCJtH5P_Q3WXT2J6pdCH6y/view?usp=sharing

 

I can make a graph file with following warning :

 

/usr/local/bin/ncsdk/Controllers/FileIO.py:52: UserWarning: You are using a large type. Consider reducing your data sizes for best performance

 

"Consider reducing your data sizes for best performance\033[0m")
0 Kudos
idata
Employee
740 Views

@hrsht.sarma As I see you are using float32. Input tensor uses half precision (fp16) values.

 

I also had problem with generating the graph. Can you please share the command line you used with mvNCCompile?
0 Kudos
idata
Employee
740 Views

mvNCCompile MobileNet_deploy.prototxt -w MobileNet_deploy.caffemodel -s 12

0 Kudos
idata
Employee
740 Views

@georgievm_cms Using fp16 half precision , i get output of length 1001 but I dont understand how to interpret this output , thanks for your help. Do you have any hints ?

 

This is how my output looks like : [ -324.25,520.0,82.812,-1400.0,-425.5,-407.5,-705.5,-1011.5,-351.5,-555.5,1123.0,264.0,923.0,331.0,-677.5………]

0 Kudos
idata
Employee
740 Views

@hrsht.sarma, why I got output of length 707 with the same caffe model you used. You only change the type to fp16 in the script above to get output of length 1001?

0 Kudos
idata
Employee
740 Views

@hrsht.sarma, the weight and prototxt you used is not mobilenet ssd, but mobilenet. That is why you got 1001 results.

 

prototxt: https://drive.google.com/file/d/1O11sw2AvG4RlG_JnzQSFodT9WTH7PKaQ/view?usp=sharing

 

caffemodel : https://drive.google.com/file/d/1d4Bfey6knTGCJtH5P_Q3WXT2J6pdCH6y/view?usp=sharing
0 Kudos
idata
Employee
740 Views

@xhuan28 @hrsht.sarma @Tome_at_Intel @georgievm_cms

 

There are now a few examples for SSD MobileNet in the ncappzoo

 

Look in the apps/video_object and caffe/SSD_MobileNet projects
0 Kudos
idata
Employee
740 Views

@hrsht.sarma, To address your original question, if you look at the run.py code here: https://github.com/movidius/ncappzoo/tree/master/caffe/SSD_MobileNet you can see how to handle the NaN values in some of the network results.

 

Neal

0 Kudos
idata
Employee
740 Views

Thanks , I am running mobilenet SSD now.

0 Kudos
idata
Employee
740 Views

@neal_at_intel , @Tome_at_Intel But mobilenet-ssd‘s some layers output is nan when use the size of image larger than 300×300.

 

Issue: https://ncsforum.movidius.com/discussion/comment/1618/#Comment_1618
0 Kudos
Reply