Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Pin h5py version to < 3.0 to workaround issues with TF/Keras #6808

Merged
merged 1 commit into from
Oct 31, 2020
Merged

[CI] Pin h5py version to < 3.0 to workaround issues with TF/Keras #6808

merged 1 commit into from
Oct 31, 2020

Conversation

leandron
Copy link
Contributor

@leandron leandron commented Oct 31, 2020

h5py recently released version 3.0 (dates can be seen here: https://pypi.org/project/h5py/#history). This breaks TF 2.3 and Keras, as reported already by others, e.g. tensorflow/tensorflow#44467.

Because of that, there are a few tests that fail:

FAILED tests/python/frontend/keras/test_forward.py::TestKeras::test_forward_resnet50[keras]
FAILED tests/python/frontend/keras/test_forward.py::TestKeras::test_forward_mobilenet[keras]
FAILED tests/python/frontend/keras/test_forward.py::TestKeras::test_forward_resnet50[tf_keras]
FAILED tests/python/frontend/keras/test_forward.py::TestKeras::test_forward_mobilenet[tf_keras]
ERROR tests/python/driver/tvmc/test_compiler.py::test_compile_keras__save_module
ERROR tests/python/driver/tvmc/test_compiler.py::test_cross_compile_aarch64_keras_module
ERROR tests/python/driver/tvmc/test_frontends.py::test_load_model__keras - At...
ERROR tests/python/driver/tvmc/test_frontends.py::test_load_model___wrong_language__to_tflite

The reason of the failures/errors indeed is the same as reported upstream:


    def load_weights_from_hdf5_group(f, layers):
      """Implements topological (order-based) weight loading.
    
      Arguments:
          f: A pointer to a HDF5 group.
          layers: a list of target layers.
    
      Raises:
          ValueError: in case of mismatch between provided layers
              and weights file.
      """
      if 'keras_version' in f.attrs:
>       original_keras_version = f.attrs['keras_version'].decode('utf8')
E       AttributeError: 'str' object has no attribute 'decode'

/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/saving/hdf5_format.py:660: AttributeError

To workaround that, this PR:

  • Pin h5py to use the previous major release (2.x) and not new version 3.0, due to incompatibilities with TF and Keras that make TVMC and Frontend tests to fail

Note: just to make it clear, this is caused by the h5py release and affects TF >= 2.1.0 so it is not related in any way with the recent update to TF 2.3.1.

cc @tqchen @u99127 @areusch @ANSHUMAN87

 * Pin h5py to use the previous major release (2.x) and not
   new version 3.0, due to incompatibilities with TF and Keras
   that make TVMC and Frontend tests to fail

 * This issue was already reported upstream at
   tensorflow/tensorflow#44467
@leandron
Copy link
Contributor Author

Thanks @tqchen for merging this today 👍

gar1t pushed a commit to guildai/guildai that referenced this pull request Nov 6, 2020
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 2, 2020
…ache#6808)

* Pin h5py to use the previous major release (2.x) and not
   new version 3.0, due to incompatibilities with TF and Keras
   that make TVMC and Frontend tests to fail
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Dec 4, 2020
…ache#6808)

* Pin h5py to use the previous major release (2.x) and not
   new version 3.0, due to incompatibilities with TF and Keras
   that make TVMC and Frontend tests to fail
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Dec 4, 2020
…ache#6808)

* Pin h5py to use the previous major release (2.x) and not
   new version 3.0, due to incompatibilities with TF and Keras
   that make TVMC and Frontend tests to fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants