Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5932 Discussions

ValueError: numpy.ndarray size changed, may indicate binary incompatibility when converting to IR

albert5
Novice
1,190 Views

[ ERROR ] -------------------------------------------------
[ ERROR ] ----------------- INTERNAL ERROR ----------------
[ ERROR ] Unexpected exception happened.
[ ERROR ] Please contact Model Optimizer developers and forward the following information:
[ ERROR ] numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject
[ ERROR ] Traceback (most recent call last):
File "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo\main.py", line 345, in main
ret_code = driver(argv)
File "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo\main.py", line 309, in driver
ret_res = emit_ir(prepare_ir(argv), argv)
File "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo\main.py", line 164, in prepare_ir
ret_code = check_requirements(framework=argv.framework)
File "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo\utils\versions_checker.py", line 219, in check_requirements
env_setup = get_environment_setup()
File "C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\mo\utils\versions_checker.py", line 199, in get_environment_setup
exec("import tensorflow")
File "<string>", line 1, in <module>
File "C:\Users\WIN10\AppData\Roaming\Python\Python38\site-packages\tensorflow\__init__.py", line 41, in <module>
from tensorflow.python.tools import module_util as _module_util
File "C:\Users\WIN10\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\__init__.py", line 47, in <module>
from tensorflow.python import keras
File "C:\Users\WIN10\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\__init__.py", line 27, in <module>
from tensorflow.python.keras import models
File "C:\Users\WIN10\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\models.py", line 26, in <module>
from tensorflow.python.keras.engine import functional
File "C:\Users\WIN10\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\engine\functional.py", line 38, in <module>
from tensorflow.python.keras.engine import training as training_lib
File "C:\Users\WIN10\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\engine\training.py", line 50, in <module>
from tensorflow.python.keras.engine import data_adapter
File "C:\Users\WIN10\AppData\Roaming\Python\Python38\site-packages\tensorflow\python\keras\engine\data_adapter.py", line 60, in <module>
import pandas as pd # pylint: disable=g-import-not-at-top
File "D:\program\anaconda3\envs\socialDistancing\lib\site-packages\pandas\__init__.py", line 29, in <module>
from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
File "D:\program\anaconda3\envs\socialDistancing\lib\site-packages\pandas\_libs\__init__.py", line 13, in <module>
from pandas._libs.interval import Interval
File "pandas\_libs\interval.pyx", line 1, in init pandas._libs.interval

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

 

Operating System : Windows 10

 

I have been following openvino docs and able to convert yolov4 into tensorflow model, but when I am converting the tensorflow model to IR this error happen. Following  is the command in openvino docs : 

python mo.py --saved_model_dir yolov4 --output_dir models/IRs --input_shape [1,608,608,3] --model_name yolov4

I have also change the input_shape and the save_model_dir accordingly. What should I do to solve this error? Thanks

Labels (1)
0 Kudos
5 Replies
IntelSupport
Community Manager
1,168 Views

Hi Albert5,

Thanks for reaching out.

I suspect the error is due to the different installed packages in your environment. What is your Numpy and TensorFlow version?

Meanwhile, I have run the conversion of the yolo-v4-tf OpenVINO model successfully. Here is my workaround :

1) Go to the Install prerequisites folder and run install_prerequisites.bat.

cd \INSTALL_DIR\openvino_2021.3.394\deployment_tools\model_optimizer\install_prerequisites

Install_prerequisites.bat


2) Go to the Downloader folder

cd INSTALL_DIR\openvino_2021.3.394\deployment_tools\open_model_zoo\tools\downloader

Run downloader.py --name yolo-v4-tf

Then, run converter.py --name yolo-v4-tf

You will get the error when running the converter but just ignore the error.


3) Check INSTALL_DIR\openvino_2021.3.394\deployment_tools\open_model_zoo\tools\downloader\public\yolo-v4-tf folder and you will see yolo-v4.pb and yolo-v4.h file


4)Go to Model Optimizer folder and run the following command:

mo.py --input_model "INSTALL_DIR\openvino_2021.3.394\deployment_tools\open_model_zoo\tools\downloader\public\yolo-v4-tf\yolo-v4.pb" --input_shape=[1,608,608,3] --input=image_input --scale_values=image_input[255] --reverse_input_channels

 

Regards,

Aznie


albert5
Novice
1,156 Views

Hi Aznie,

Thank you for replying I have already tried the one you are asking but it only produce yolo-v4.h5 in 2nd step and it seems that the step you provided me is for a default yolov4, but I am actually trying to convert my own custom trained YOLO V4 to openvino models. If you could provide me a step for that instead? Thanks you

IntelSupport
Community Manager
1,130 Views

Hi Albert5,

Have you tried converting your custom model with the parameters that I shared before? You also can refer to this model.yml file for the model_optimizer arguments for yolo-v4-tf model.

However, I suspect the error you got is due to the version of the different packages of your Numpy and TensorFlow. Please try to reinstall or upgrade the Numpy and convert your model again. Also, could you share your frozen model for us to test on our side?

 

Meanwhile, I would recommend you upgrade your OpenVINO to our latest version (2021.4) for better features supportability.

 

 Regards,

Aznie

 

IntelSupport
Community Manager
1,083 Views

Hi Albert5,

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,

Aznie


albert5
Novice
1,020 Views

Hi I am able to sucessfully convert from YOLO to IR now, but there is still problem after converting the model become wrong / problematic with 2 problems that I notice:

1. The confidence and the prediction class disappear

2. There is something wrong with the calculation as the return bounding box have inf value.

As from what I see from the conversion log nothing should be wrong . Below is my conversion log:

Model Optimizer arguments:
Common parameters:
- Path to the Input Model: None
- Path for generated IR: C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\models/IRs
- IR output name: yolov4
- Log level: ERROR
- Batch: Not specified, inherited from the model
- Input layers: Not specified, inherited from the model
- Output layers: Not specified, inherited from the model
- Input shapes: [1,416,416,3]
- Mean values: Not specified
- Scale values: Not specified
- Scale factor: Not specified
- Precision of IR: FP32
- Enable fusing: True
- Enable grouped convolutions fusing: True
- Move mean values to preprocess section: None
- Reverse input channels: False
TensorFlow specific parameters:
- Input model in text protobuf format: False
- Path to model dump for TensorBoard: None
- List of shared libraries with TensorFlow custom layers implementation: None
- Update the configuration file with input/output node names: None
- Use configuration file used to generate the model with Object Detection API: None
- Use the config file: None
- Inference Engine found in: C:\Program Files (x86)\Intel\openvino_2021.3.394\python\python3.8\openvino
Inference Engine version: 2.1.2021.3.0-2787-60059f2c755-releases/2021/3
Model Optimizer version: 2021.3.0-2787-60059f2c755-releases/2021/3
[ SUCCESS ] Generated IR version 10 model.
[ SUCCESS ] XML file: C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\models\IRs\yolov4.xml
[ SUCCESS ] BIN file: C:\Program Files (x86)\Intel\openvino_2021.3.394\deployment_tools\model_optimizer\models\IRs\yolov4.bin
[ SUCCESS ] Total execution time: 31.73 seconds.

Please help Thank you

Reply