Skip to content

updates Keras and tensorflow version [MNT]#47

Closed
solegalli wants to merge 3 commits into
eli5-org:masterfrom
solegalli:keras_fixes
Closed

updates Keras and tensorflow version [MNT]#47
solegalli wants to merge 3 commits into
eli5-org:masterfrom
solegalli:keras_fixes

Conversation

@solegalli

@solegalli solegalli commented Jan 27, 2025

Copy link
Copy Markdown
Contributor

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

lopuhin commented Feb 1, 2025

Copy link
Copy Markdown
Contributor

@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

lopuhin commented Mar 30, 2025

Copy link
Copy Markdown
Contributor

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

@lopuhin

lopuhin commented Apr 20, 2025

Copy link
Copy Markdown
Contributor

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