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.

Converting SSD-mobilenet

idata
Employee
1,417 Views

Hi guys,

 

I am trying to covert the SSD mobilenet in ncappzoo/caffe/SSD_MobileNet

 

I followed the instructions on git to finetune the model on my own data. Once I had the model I tried to compile it for movidius:

 

mvNCCompile -w mobilenet-ssd-deploy.caffemodel -s 12 MobileNetSSD_deploy.prototxt

 

but getting this:

 

mvNCCompile v02.00, Copyright @ Movidius Ltd 2016

 

[Error 17] Toolkit Error: Internal Error: Could not build graph. Missing link: conv11_mbox_conf

 

Do you have any idea why I am seeing this? When I check the prototxt it does have that layer but it has '_new' appended to it so it would be e.g. conv11_mbox_conf_new

 

I dont know why is it looking for conv11_mbox_conf when the prototxt has conv11_mbox_conf…

 

Thanks for your help!

0 Kudos
12 Replies
idata
Employee
1,067 Views

The same issue.

0 Kudos
idata
Employee
1,067 Views

I found the cause. When mvNCCompile parses the caffe model, it builds a tree. But it only attaches the bottom blob and uses layer name as top blob. The compiler has logic to deal with renaming, while it fails in this condition.

 

My temporary solution is:

 

sudo find / -name NetworkStage.py # /usr/local/bin/ncsdk/Models/NetworkStage.py in my server # insert the following lines at line 86 if ''_new' in name: self.alias.append(name[0:len(name) - 1])

 

Then it works.

0 Kudos
idata
Employee
1,067 Views

@huxh10 I think the fix should be:

 

if '_new' in name: self.alias.append(name[0:-4])

 

at line 86, name[0:len(name) - 1] works the same as line 85

 

self.alias = [name]
0 Kudos
idata
Employee
1,067 Views

I manged to compile a ncs model with the solution above,

 

if '_new' in name: self.alias.append(name[0:-4])

 

but when I run the model on Raspberry with NCS for detection, I got such ERROR:

 

[INFO] finding NCS devices... [INFO] found 1 devices. device0 will be used. opening device0... [INFO] loading the graph file into RPi memory... [INFO] allocating the graph on the NCS... Traceback (most recent call last): File "count_for_video_ncs.py", line 267, in <module> count_for_video_ncs(img_dir, start_index, end_index) File "count_for_video_ncs.py", line 183, in count_for_video_ncs predictions = predict(image_np, detection_graph) File "count_for_video_ncs.py", line 58, in predict (output, _) = graph.GetResult() File "/usr/local/lib/python2.7/dist-packages/mvnc/mvncapi.py", line 264, in GetResult raise Exception(Status(status)) Exception: mvncStatus.MYRIAD_ERROR
0 Kudos
idata
Employee
1,067 Views

@cweihang Can you provide your model files (caffemodel and prototxt) and your python script?

0 Kudos
idata
Employee
1,067 Views

@Tome_at_Intel I follow this repository https://github.com/chuanqi305/MobileNet-SSD ,

 

 

mvNCCompile template/MobileNetSSD_deploy.prototxt -w MobileNetSSD_deploy.caffemodel -s 12 -is 300 300 -o ncs_mobilenet_ssd_graph

 

and meet the ERROR in the question

 

[Error 17] Toolkit Error: Internal Error: Could not build graph. Missing link: conv11_mbox_conf

 

and try to fix with this alia replacement

 

if '_new' in name: self.alias.append(name[0:-4])

 

but fail to run the model with this Exception:

 

[INFO] finding NCS devices... [INFO] found 1 devices. device0 will be used. opening device0... [INFO] loading the graph file into RPi memory... [INFO] allocating the graph on the NCS... Traceback (most recent call last): File "count_for_video_ncs.py", line 267, in <module> count_for_video_ncs(img_dir, start_index, end_index) File "count_for_video_ncs.py", line 183, in count_for_video_ncs predictions = predict(image_np, detection_graph) File "count_for_video_ncs.py", line 58, in predict (output, _) = graph.GetResult() File "/usr/local/lib/python2.7/dist-packages/mvnc/mvncapi.py", line 264, in GetResult raise Exception(Status(status)) Exception: mvncStatus.MYRIAD_ERROR
0 Kudos
idata
Employee
1,067 Views

I met mvncStatus.MYRIAD_ERROR with the ncsdk in python2, after I reinstalled the sdk in python3, the runttime problem disappeared.

 

And it's really necessary for this fix in NetworkStage when your model contain layer named '*_new':

 

if '_new' in name: self.alias.append(name[0:-4])
0 Kudos
idata
Employee
1,067 Views

@cweihang So you actually succeeded in deploying a finetuned SSD MobileNet on the NCS following these steps above? What FPS can you get?

0 Kudos
idata
Employee
1,067 Views

Was anybody able to achieve the above? Let us know.

0 Kudos
idata
Employee
1,067 Views

@cweihang At which line should i add these lines?

0 Kudos
idata
Employee
1,067 Views

I got the same error mentioned and was fixed after editing /usr/local/bin/ncsdk/Models/NetworkStage.py as mentioned. I have a 4.5 fps for my custom object detection.

0 Kudos
idata
Employee
1,067 Views

This has been very helpful!

0 Kudos
Reply