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.

ValueError: cannot reshape array of size 172380 into shape (1,18,26,26)

Coghi__Alexander
Beginner
6,827 Views

Good morning people I have a problem, that when I execute the code of my converted model, it gives shape error, I was wondering why mine doesn't work.

 

python3 /opt/intel/openvino_2019.3.376/deployment_tools/open_model_zoo/demos/python_demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.py \
> -i /dev/video0 \
> -m /home/intel/Documents/Openvino-Yolo/douglas/FP16/frozen_darknet_yolov3_model.xml \
> -l /home/intel/libcpu_extension.so \
> -d CPU
[ INFO ] Creating Inference Engine...
[ INFO ] Loading network files:
    /home/intel/Documents/Openvino-Yolo/douglas/FP16/frozen_darknet_yolov3_model.xml
    /home/intel/Documents/Openvino-Yolo/douglas/FP16/frozen_darknet_yolov3_model.bin
[ INFO ] Preparing inputs
[ WARN:0] global /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/videoio/src/cap_gstreamer.cpp (1757) handleMessage OpenCV | GStreamer warning: Embedded video playback halted; module source reported: Could not read from resource.
[ WARN:0] global /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/videoio/src/cap_gstreamer.cpp (886) open OpenCV | GStreamer warning: unable to start pipeline
[ WARN:0] global /home/jenkins/workspace/OpenCV/OpenVINO/build/opencv/modules/videoio/src/cap_gstreamer.cpp (480) isPipelinePlaying OpenCV | GStreamer warning: GStreamer: pipeline have not been created
libva info: VA-API version 1.4.1
libva info: va_getDriverName() returns 0
libva info: User requested driver 'iHD'
libva info: Trying to open /opt/intel/mediasdk/lib64/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_4
libva info: va_openDriver() returns 0
MFX: Unsupported extension: /dev/video0
VIDEOIO ERROR: V4L2: property frame_count is not supported
[ INFO ] Loading model to the plugin
[ INFO ] Starting inference...
To close the application, press 'CTRL+C' here or switch to the output window and press ESC key
To switch between sync/async modes, press TAB key in the output window
Traceback (most recent call last):
  File "/opt/intel/openvino_2019.3.376/deployment_tools/open_model_zoo/demos/python_demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.py", line 359, in <module>
    sys.exit(main() or 0)
  File "/opt/intel/openvino_2019.3.376/deployment_tools/open_model_zoo/demos/python_demos/object_detection_demo_yolov3_async/object_detection_demo_yolov3_async.py", line 276, in main
    out_blob = out_blob.reshape(net.layers[net.layers[layer_name].parents[0]].shape)
ValueError: cannot reshape array of size 172380 into shape (1,18,26,26)

 

 

0 Kudos
7 Replies
JesusE_Intel
Moderator
6,827 Views

Hi Alexander,

Looking at your description, it sounds like you have custom trained YOLOv3 model from DarkNet.

  • How did you convert your weights file to TensorFlow (.pb) and TensorFlow to IR format?
  • Could you provide the commands?
  • What TensorFlow version did you use for training and converting the weights file?
  • Could you share the model for me to test from my end? I will also need your configuration file (.cfg).

Also, please try updating your OpenVINO toolkit to the 2020.1 release.

Regards,

Jesus

 

0 Kudos
Tsiga__George
Beginner
6,826 Views

I am also having a similar problem with the samples. https://github.com/opencv/open_model_zoo/tree/master/demos/python_demos/text_spotting_demo

0 Kudos
Sadmi
Beginner
5,637 Views

Hi,

 

I tried running Yolov4 and I a got a similar issue:

I'm using OpenVino 2020R4 with this code https://github.com/SadmiB/OpenVINO-YOLOV4/blob/master/object_detection_demo_yolov4_async.py

Regards.

Sadmi_0-1609946733508.png

 

0 Kudos
Sandeep0101
Beginner
5,424 Views

Was anyone able to solve this issue? 

I am getting this error in yolov3 tiny model .

0 Kudos
JesusE_Intel
Moderator
6,826 Views

Hi George,

Could you please provide the error message you are seeing and commands used?

Regards,

Jesus

0 Kudos
zian123
Novice
5,090 Views

Has anyone manage to solve the issue? 

ValueError: cannot reshape array of size 172380 into shape (1,18,26,26)- This one!

I am getting the same error.

https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Running-Custom-IR-files-in-Video/td-p/1300212 Here I mentioned about it.

 

(OpenVino_env) C:\Program Files (x86)\IntelSWTools\openvino_2021.4.582\inference_engine\demos\object_detection_demo\python>python object_detection_demo.py --labels "C:/Users/Md. Afique Amin Zian/Desktop/tensorflow-yolo-v3-master/coco.names" -i "C:/Users/Md. Afique Amin Zian/Desktop/tensorflow-yolo-v3-master/video.avi" -m "C:/Users/Md. Afique Amin Zian/Desktop/tensorflow-yolo-v3-master/frozen_darknet_yolov3_model.xml" -at yolo


[ INFO ] Initializing Inference Engine...
[ INFO ] Loading network...
[ INFO ] Reading network from IR...
[ INFO ] Loading network to CPU plugin...
MFX: Unsupported extension: C:/Users/Md. Afique Amin Zian/Desktop/tensorflow-yolo-v3-master/video.avi
[ INFO ] Starting inference...
To close the application, press 'CTRL+C' here or switch to the output window and press ESC key
Traceback (most recent call last):
File "object_detection_demo.py", line 350, in <module>
sys.exit(main() or 0)
File "object_detection_demo.py", line 260, in main
results = detector_pipeline.get_result(next_frame_id_to_show)
File "C:\Program Files (x86)\IntelSWTools\openvino_2021.4.582\deployment_tools\open_model_zoo\demos\common\python\pipelines\async_pipeline.py", line 132, in get_result
return self.model.postprocess(raw_result, preprocess_meta), meta
File "C:\Program Files (x86)\IntelSWTools\openvino_2021.4.582\deployment_tools\open_model_zoo\demos\common\python\models\yolo.py", line 206, in postprocess
out_blob.shape = layer_params[0]
ValueError: cannot reshape array of size 172380 into shape (1,24,26,26)

0 Kudos
acekrystal
Beginner
4,758 Views

I'm having this same issue with a custom trained yolov3/4 model : 

OpenCV: FFMPEG: tag 0x47504a4d/'MJPG' is not supported with codec id 7 and format 'image2 / image2 sequence'
Traceback (most recent call last):
File "/opt/intel/openvino_2021/deployment_tools/open_model_zoo/demos/object_detection_demo/python/object_detection_demo.py.orig", line 361, in <module>
sys.exit(main() or 0)
File "/opt/intel/openvino_2021/deployment_tools/open_model_zoo/demos/object_detection_demo/python/object_detection_demo.py.orig", line 331, in main
results = detector_pipeline.get_result(next_frame_id_to_show)
File "/opt/intel/openvino_2021.4.689/deployment_tools/open_model_zoo/demos/common/python/pipelines/async_pipeline.py", line 132, in get_result
return self.model.postprocess(raw_result, preprocess_meta), meta
File "/opt/intel/openvino_2021.4.689/deployment_tools/open_model_zoo/demos/common/python/models/yolo.py", line 214, in postprocess
out_blob.shape = layer_params[0]
ValueError: cannot reshape array of size 43095 into shape (1,21,13,13)

 

Still looking for a solution

IR made with : 
- Depth-AI Yolov4 colab
- converted to TensorFlow 1.14 + Keras 2.6.0
- converted to IR

0 Kudos
Reply