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

Framework error when converting a HDF5 model into OpenVINO IR format model (continue)

nat98
New Contributor I
575 Views

Hi,

 

Referring to the post: https://community.intel.com/t5/Intel-Distribution-of-OpenVINO/Framework-error-when-converting-a-HDF5-model-into-OpenVINO-IR/m-p/1418999, I have successfully converted my model from HDF5 to PB file format and also from PB to IR format.

 

Recently, I have modified my model and I have a new model in the HDF5 format. After that convert the new model from HDF5 to PB format. I was getting the same error when converting from PB to IR format, which is,

[ ERROR ] Cannot infer shapes or values for node "StatefulPartitionedCall_1".
[ ERROR ] Expected DataType for argument 'dtype' not <class 'str'>.

...

 

Then I realized the problem is the conversion from HDF5 to PB was having issues, in which the converted file size is too small (0.6 MB as supposed to 1.8 MB).

 

So, I follow back the steps in the post above (which is to install the TensorFlow 2 prerequisites before the conversion). And after installing TensorFlow 2 prerequisites, and running the conversion code, my converted model file size is the same at 0.6 MB.

 

May I know why does it works last time and how to make it work again?

 

Thanks for reading my post.

 

Regards,

Nathaniel

0 Kudos
1 Solution
Peh_Intel
Moderator
501 Views

Hi Nathaniel,

 

Yes, you are right. The SavedModel format should be around 1.8MB after serializing.


When installing the prerequisites for TensorFlow 2, TensorFlow version 2.4.1 should be installed. Please try to upgrade your TensorFlow 2 manually to version 2.4.1 and serialize the HDF5 file into SavedModel format again.



Regards,

Peh


View solution in original post

0 Kudos
5 Replies
Peh_Intel
Moderator
542 Views

Hi Nathaniel,


Could you share your models (hdf5 and SavedModel format) with us for justification?


Besides, please also check your TensorFlow and h5py version.

python3

import tensorflow

print(tensorflow.__version__)

import h5py

print(h5py.__version__)



Regards,

Peh


0 Kudos
nat98
New Contributor I
517 Views

Hi Peh,

 

Here are the links to my models in hdf5 and SavedModel format.

 

HDF5: https://drive.google.com/file/d/1jOGuzlvvdUEECpDAO1hd88465T1C0omJ/view?usp=sharing

Saved Model: https://drive.google.com/file/d/1C_FkBZR5cVRtLLZ3XwgoBPtLyN3QhxXm/view?usp=sharing

 

Also, my TensorFlow and h5py version (attached screenshot shows the terminal): 

python3
>>> import tensorflow
>>> print(tensorflow.__version__)
2.1.0
>>> import h5py
>>> print(h5py.__version__)
2.10.0

 

Regards,

Nathaniel

0 Kudos
Peh_Intel
Moderator
502 Views

Hi Nathaniel,

 

Yes, you are right. The SavedModel format should be around 1.8MB after serializing.


When installing the prerequisites for TensorFlow 2, TensorFlow version 2.4.1 should be installed. Please try to upgrade your TensorFlow 2 manually to version 2.4.1 and serialize the HDF5 file into SavedModel format again.



Regards,

Peh


0 Kudos
nat98
New Contributor I
458 Views

Hi Peh,

 

I upgraded my TensorFlow to version 2.4.1 and now the SavedModel format after serializing is 1.8MB as expected.

 

Thanks again for solving my issue.

 

Regards,

Nathaniel 

0 Kudos
Peh_Intel
Moderator
452 Views

Hi Nathaniel,


I'm glad I was able to solve your issue.


This thread will no longer be monitored since this issue has been resolved. If you need any additional information from Intel, please submit a new question.



Regards,

Peh


0 Kudos
Reply