all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Zacchaeus Scheffer <Zacchaeus.Scheffer@synaptics.com>
To: 60545@debbugs.gnu.org
Subject: bug#60545: Keras h5py Version Mismatch
Date: Wed, 4 Jan 2023 01:37:34 +0000	[thread overview]
Message-ID: <CY4PR03MB27591E805538BEE2A385256098F59@CY4PR03MB2759.namprd03.prod.outlook.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 5052 bytes --]

             reply	other threads:[~2023-01-04 22:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04  1:37 Zacchaeus Scheffer [this message]
2023-01-06 14:40 ` bug#60545: Keras h5py Version Mismatch zimoun
2023-01-31 23:01   ` Zacchaeus Scheffer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR03MB27591E805538BEE2A385256098F59@CY4PR03MB2759.namprd03.prod.outlook.com \
    --to=zacchaeus.scheffer@synaptics.com \
    --cc=60545@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.