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.
6392 Discussions

Model loading on Neural Compute Stick (v1) fails

GSrin4
Novice
1,385 Views

I am trying to load the YoloV3 model trained with Custom data. I was successfully able to convert that to IR format. But when I try to load the model to NCS, I am getting the following error. Please find the python code used and the error.

 

Tensorflow model code: https://github.com/YunYang1994/tensorflow-yolov3.git

 

from openvino.inference_engine import IENetwork, IECore ie = IECore() net = IENetwork(model='./inference_graph.xml', weights='./inference_graph.bin') exec_net = ie.load_network(network=net, device_name='myriad')   error: AssertionFailed: newDims[newPerm[i]] == 1  

Commands used to convert the inference graph

python3 /opt/intel/vino/openvino/deployment_tools/model_optimizer/mo_tf.py --input_model_is_text --input_model inference_graph.pb --data_type FP16 --input_shape [1,320,320,3] --disable_fusing --disable_gfusing

Any suggestion or references would be greatly appreciated.

 

PS: Please find the attached files.

 

Thank you,

Gunasekaran

14 Replies
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

 Thank you for contacting Intel Customer Support. It appears your are having issues running inference with your model. I recommend testing your IR files with our Python YOLOv3 Demo included with OpenVINO. You can also find it on the Open Model Zoo GitHub Repository. 

 

You will have to convert the IR files again with the --reverse_input_channel flag to use the model with our demos. 

 

Regards, 

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

 

0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

I hope you are doing well. Did you manage to solve your issue?

 

If you need further assistance, let me know.

 

Regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

 

0 Kudos
GSrin4
Novice
1,101 Views

Hi David,

 

I have tried your suggestion. Please find the attached error I am facing.

python3 object_detection_demo_yolov3_async.py -m ./inference_graph.xml -i ./114.jpg -d myriad --labels ./labels.txt

 

[ INFO ] Creating Inference Engine... [ INFO ] Loading network files: ./inference_graph.xml ./inference_graph.bin [ INFO ] Preparing inputs [ INFO ] Loading model to the plugin Traceback (most recent call last): File "object_detection_demo_yolov3_async.py", line 359, in <module> sys.exit(main() or 0) File "object_detection_demo_yolov3_async.py", line 231, in main exec_net = ie.load_network(network=net, num_requests=2, device_name=args.device) File "ie_api.pyx", line 85, in openvino.inference_engine.ie_api.IECore.load_network File "ie_api.pyx", line 92, in openvino.inference_engine.ie_api.IECore.load_network RuntimeError: AssertionFailed: newDims[newPerm[i]] == 1

Command used to convert the pb file as per your suggestion.

 

python3 /opt/intel/vino/openvino/deployment_tools/model_optimizer/mo_tf.py --input_model inference_graph.pb --data_type FP16 --input_shape [1,320,320,3] --disable_fusing --disable_gfusing --reverse_input_channel

 

Please advice.

 

Thank you,

Guna

0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

Thank you for the information provided.

 

I have done some tests, but in order to give you a proper answer, I need your custom frozen model, so if you are able to share it publicly it would be great, if not, you can send it through a private message.

 

If you have more questions, I will be glad to help you

 

Best regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

0 Kudos
GSrin4
Novice
1,101 Views
0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

Thank you for your reply.

 

I'd like to convert this model to IR on my end and test it. Could you please send over the frozen Tensorflow model (the .pb file)?

 

  

Regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

 

0 Kudos
GSrin4
Novice
1,101 Views

Hi David,

 

In the attachment, "inference_graph.pb" is the frozen graph from Tensorflow.

 

Hope it helps,

Gunaekaran

0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

Thank you for sharing your files.

 

I am looking into your issue, and will get back to you as soon as possible.

  

Regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

 

 

0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

Thank you for your patience.

 

We looked into the IR files and it looks like the model has 3 extra output layers that are no present in the standard YOLOv3.

   - output #0 name: pred_lbbox/concat_1/YoloRegion

   - output #2 name: pred_mbbox/concat_1/YoloRegion

   - output #3 name: pred_mbbox/strided_slice_2/Split.2

   - output #4 name: pred_sbbox/concat_1/YoloRegion

   - output #5 name: pred_sbbox/strided_slice_2/Split.2

 

expected:

   - output #0 name: detector/yolo-v3/Conv_14/BiasAdd/YoloRegion

   - output #1 name: detector/yolo-v3/Conv_22/BiasAdd/YoloRegion

   - output #2 name: detector/yolo-v3/Conv_6/BiasAdd/YoloRegion

 

Would it be possible to use the tested YoloV3 model (as we are not familiar with the changes made to this model) mentioned in the documentation?

 

  

Regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

 

0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

I am contacting you to give a follow up on this case. Could you please tell me if your issue is solved?

 

Feel free to contact us in case you need further assistance.

 

Best regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

0 Kudos
GSrin4
Novice
1,101 Views

Hi David,

 

The tested model expects the model in in darknet format. I have trained my model in pure Tensorflow implementation. It needs some efforts to port my data set to darkent format and I need to retrain the model. That's quite bit of work and I dont want to do that just because NCS needs data in that format.

 

Is there any other ways.

 

PS: Sorry for the delayed response as I was looking for other options.

 

Regards,

Gunasekaran

0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

Thank you for your response.

 

I will attempt to find an alternative to the issue, but I can't guarantee this would work, as the tested YoloV3 model was originally implemented in Darknet framework.

 

I will reply you back as soon as possible, if you have any other doubts, do not hesitate to contact us.

 

Regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

0 Kudos
David_C_Intel
Employee
1,101 Views

Hi GSrin4,

 

Thank you for your patience.

 

Unfortunately, we couldn't find an alternative to this, our recommendation would be to use the tested YoloV3 model as we previously mentioned.

 

If you have any other questions, feel free to ask.

 

Best Regards,

 

David C.

Intel Customer Support Technician

A Contingent Worker at Intel

 

0 Kudos
ybai
Beginner
999 Views

Hi David,

 

I have the same issue, so much time has passed, any progress on finding the alternative to this issue?

 

Thanks,

Yu

 

0 Kudos
Reply