GNU bug report logs - #60545
Keras h5py Version Mismatch

Previous Next

Package: guix;

Reported by: Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com>

Date: Wed, 4 Jan 2023 07:35:03 UTC

Severity: normal

Merged with 60608

To reply to this bug, email your comments to 60545 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#60545; Package guix. (Wed, 04 Jan 2023 07:35:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Wed, 04 Jan 2023 07:35:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com>
To: "bug-guix <at> gnu.org" <bug-guix <at> gnu.org>
Subject: Keras h5py Version Mismatch
Date: Wed, 4 Jan 2023 01:37:34 +0000
[Message part 1 (text/plain, inline)]
Hi Guix!


It would seem that the current keras version expects an earlier h5py version for loading models.  Specifically, running:

from tensorflow.keras.models import load_model
model = load_model("model.h5")

fails with:

  File "/gnu/store/idfn4l2kxil9id21v1yci4jcw6103fah-profile/lib/python3.9/site-packages/tensorflow/python/keras/engine/saving.py", line 228, in load_model
    model_config = json.loads(model_config.decode('utf-8'))
AttributeError: 'str' object has no attribute 'decode'

The above works fine in my local pip environment (see below).  A quick search online indicates that this can be fixed by downgrading h5py to version 2.10.  The current h5py version in guix is 3.6.

My assumption is that this could also be fixed with an upgrade to keras, but upgrading keras sounds much more involved.  For a short-term fix, would it be possible to add back a package definition for an earlier h5py in addition to the current version?  I'm sure an appropriate version exists somewhere in guix's git history, though my git-foo is too weak for me to check.


Thanks,
Zacchae


P.S.
working (pip): keras 2.10.0, h5py 3.7.0
not working (current guix): keras 2.2.4, h5py 3.6.0
[Message part 2 (text/html, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#60545; Package guix. (Fri, 06 Jan 2023 16:31:02 GMT) Full text and rfc822 format available.

Message #8 received at 60545 <at> debbugs.gnu.org (full text, mbox):

From: zimoun <zimon.toutoune <at> gmail.com>
To: Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com>,
 60545 <at> debbugs.gnu.org
Subject: Re: bug#60545: Keras h5py Version Mismatch
Date: Fri, 06 Jan 2023 15:40:41 +0100
Hi,

On Wed, 04 Jan 2023 at 01:37, Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com> wrote:

> working (pip): keras 2.10.0, h5py 3.7.0
> not working (current guix): keras 2.2.4, h5py 3.6.0

Indeed, it is collateral to ea403bf290f4bf8c7bae314e32dbb90653f92996

--8<---------------cut here---------------start------------->8---
gnu: python-h5py: Update to 3.6.0.

* gnu/packages/python-xyz.scm (python-h5py): Update to 3.6.0.
[arguments]: Set HDF5_DIR variable instead of patching files.
--8<---------------cut here---------------end--------------->8---

Well, the update of Keras to 2.11.0 (the current latest) requires some
work.  First, fetch from Github instead of PyPI because the sources are
not available after v2.6.0; e.g.,

    https://pypi.org/project/keras/2.11.0/#files

Then, second adapt the recipe.  Do you want to give a try?


Cheers,
simon





Merged 60545 60608. Request was from Simon Tournier <zimon.toutoune <at> gmail.com> to control <at> debbugs.gnu.org. (Mon, 09 Jan 2023 12:21:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#60545; Package guix. (Wed, 01 Feb 2023 01:57:01 GMT) Full text and rfc822 format available.

Message #13 received at 60545 <at> debbugs.gnu.org (full text, mbox):

From: Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com>
To: zimoun <zimon.toutoune <at> gmail.com>, "60545 <at> debbugs.gnu.org"
 <60545 <at> debbugs.gnu.org>
Subject: Re: bug#60545: Keras h5py Version Mismatch
Date: Tue, 31 Jan 2023 23:01:16 +0000
[Message part 1 (text/plain, inline)]
Hi,

I should probably mention that I am not looking into this.  I want to learn more guix, but keras and the additional dependencies required for later versions is kind of a monster to me at the moment.

Thanks,
Zacchae
________________________________
From: zimoun <zimon.toutoune <at> gmail.com>
Sent: Friday, January 6, 2023 6:40 AM
To: Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com>; 60545 <at> debbugs.gnu.org <60545 <at> debbugs.gnu.org>
Subject: Re: bug#60545: Keras h5py Version Mismatch

CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe.


Hi,

On Wed, 04 Jan 2023 at 01:37, Zacchaeus Scheffer <Zacchaeus.Scheffer <at> synaptics.com> wrote:

> working (pip): keras 2.10.0, h5py 3.7.0
> not working (current guix): keras 2.2.4, h5py 3.6.0

Indeed, it is collateral to ea403bf290f4bf8c7bae314e32dbb90653f92996

--8<---------------cut here---------------start------------->8---
gnu: python-h5py: Update to 3.6.0.

* gnu/packages/python-xyz.scm (python-h5py): Update to 3.6.0.
[arguments]: Set HDF5_DIR variable instead of patching files.
--8<---------------cut here---------------end--------------->8---

Well, the update of Keras to 2.11.0 (the current latest) requires some
work.  First, fetch from Github instead of PyPI because the sources are
not available after v2.6.0; e.g.,

    https://urldefense.proofpoint.com/v2/url?u=https-3A__pypi.org_project_keras_2.11.0_-23files&d=DwIBAg&c=7dfBJ8cXbWjhc0BhImu8wVIoUFmBzj1s88r8EGyM0UY&r=1moyBSYvgSFmdTYHNEHEwakZGFkPl3pixLezH1qWWXFZPpSXOvpoeGr4XIg6G8V0&m=NqD4egq46utBpoyT-8Gr6A3lESGvdg2j7CIMrB0r_y4I-pFRV2Gxn2-Lb7s7tsyD&s=Ro23h-Sd5x7VKOXeIYl4j5KGqDMAyZprruKUgdacbCo&e=

Then, second adapt the recipe.  Do you want to give a try?


Cheers,
simon

[Message part 2 (text/html, inline)]

This bug report was last modified 2 years and 134 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.