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

Reshape API resizes ssd mobilenet v2 coco model but crashes for faster rcnn inception v2 model

simranS
Beginner
1,106 Views

Hi, I have varied input shape images for my tensorflow faster rcnn object detection model, hence using the Shape Inference for resizing my network, but it crashes as below:

ubuntu@ubuntu:~/inference_engine_samples_build/intel64/Release$ ./hello_reshape_ssd /home/ubuntu/Downloads/Invoice_latest_30Sept/IR/frozen_inference_graph.xml /home/ubuntu/Downloads/Invoice_latest_30Sept/Test_18/deanandavid_20191026_page-0001.jpg CPU 1
Resizing network to the image size = [817x463] with batch = 1
munmap_chunk(): invalid pointer
Aborted (core dumped)

But when I tried using a ssd mobilenet v2 coco the network reshaped successfully:

ubuntu@ubuntu:~/inference_engine_samples_build/intel64/Release$ ./hello_reshape_ssd /home/ubuntu/Downloads/ssd_mobilenet_v2_coco_2018_03_29/IR-2/frozen_inference_graph.xml /home/ubuntu/Downloads/Invoice_latest_30Sept/Test_18/deanandavid_20191026_page-0001.jpg CPU 1
Resizing network to the image size = [817x463] with batch = 1
Resulting input shape = [1,3,817,463]
Resulting output shape = [1,1,100,7]
The resulting image was saved in the file: hello_reshape_ssd_output.jpg

 

Are only ssd models supported for network resize using the Reshape API ?

Labels (2)
0 Kudos
4 Replies
IntelSupport
Moderator
1,077 Views

Hi Simran,

 

Thanks for reaching out to us. I can see that you are running hello_reshape_ssd C++ Sample using Faster RCNN Inception V2 model. Inference Engine samples stretch input image to the size of the input layer without preserving aspect ratio. But this behaviour is incorrect for Faster RCNN Inception V2 model.

 

Further information is available at the following link (Point 1) :

https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models.html#important_notes_about_feeding_input_images_to_the_samplesnformation.

 

Regards,

Adli


0 Kudos
simranS
Beginner
1,069 Views

Hi,

Understood. So the Shape Inference feature cannot be used in this case?

I used Shape Inference because I have trained my faster rcnn model on varied input shape images, then I created IR with --input_Shape [1,600,1024,3]. After this when I tried inferencing with object_detection_sample_ssd.py I find poor detections, that is,  some images the detections are misaligned and some images with no detections.

Is there an another solution to this issue than the shape inference or should I try to  resize images before inferencing  to [1,600,1024,3] (same as IR input shape) and then give as input to the inference sample as stated in this link https://docs.openvinotoolkit.org/latest/openvino_docs_MO_DG_prepare_model_convert_model_tf_specific_Convert_Object_Detection_API_Models.html#fixed_shape_resizer_replacement

Stated as: If keeping aspect ratio is required, then it is necessary to resize image before passing it to the sample.

0 Kudos
IntelSupport
Moderator
1,046 Views

Hi Simran,

 

For Faster RCNN Inception V2 model, I would recommend you to try resizing the image before passing it to the inference engine sample. If you could, please share and post the result here.

 

Regards,

Adli


0 Kudos
IntelSupport
Moderator
1,010 Views

Hi Simran,


This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.


Regards,

Adli


0 Kudos
Reply