Skip to content

updates Keras and tensorflow version [MNT] #47

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

Closed
wants to merge 3 commits into from

Conversation

solegalli
Copy link
Contributor

@solegalli solegalli commented Jan 27, 2025

At the moment, there are 4 tests that are failing in test_keras.py. But more important than that, Keras has migrated its backend functionality.

Currently, we do import keras.backend as K and from K we use functions like argmax, gradient and so on. Those functions don't live there any more. I think, we may find them in tensforflow.keras.backend, but I am not absolutely sure. Anyhow, if we swap keras.backend for tensorflow.keras.backend, then we get other errors, like keras can't accept a tensorflow tensor.

I am not an avid Keras/tensorflow user, so I am a bit lost here. Any help/pointers will be welcome!

Anyhow, i think we need to update the files explain_prediction.py and grandcam.py inside the keras folder inside eli5.

FYI @lopuhin @kmike

@lopuhin
Copy link
Contributor

lopuhin commented Feb 1, 2025

@solegalli I think with current state of Keras 3, it seems better to target using keras instead of tensorflow.keras, even if we still will only support/test tensorflow backend of keras. Some operations like argmax are present in keras.ops: https://keras.io/api/ops/numpy/#argmax-function but porting the rest of the code could be non-trivial.

@lopuhin
Copy link
Contributor

lopuhin commented Mar 30, 2025

See also #31 which seems to add support for more recent TF versions

@lopuhin
Copy link
Contributor

lopuhin commented Apr 20, 2025

Thanks for starting this @solegalli , let me close this one as now we support modern Keras via #58

@lopuhin lopuhin closed this Apr 20, 2025
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