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.
6571 ディスカッション

Mobilenet-ssd caffe model gives NaN as output

idata
従業員
1,897件の閲覧回数

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 件の賞賛
12 返答(返信)
idata
従業員
1,547件の閲覧回数

@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.

idata
従業員
1,547件の閲覧回数

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

idata
従業員
1,547件の閲覧回数

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")
idata
従業員
1,547件の閲覧回数

@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?
idata
従業員
1,547件の閲覧回数

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

idata
従業員
1,547件の閲覧回数

@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………]

idata
従業員
1,547件の閲覧回数

@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?

idata
従業員
1,547件の閲覧回数

@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
idata
従業員
1,547件の閲覧回数

@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
idata
従業員
1,547件の閲覧回数

@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

idata
従業員
1,547件の閲覧回数

Thanks , I am running mobilenet SSD now.

idata
従業員
1,547件の閲覧回数

@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
返信