-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Compatibility between tensorboard and keras3/keras-core to display functional model graphs #6686
Comments
Thank you for this detailed issue! I have added this to out internal hotlist. I hope we can get to it soon! |
More context: we recently pinned to Keras 2 before fully migrating our codebase to Keras 3: #6684 Apologies for the inconvenience! |
Ok, i understand, thanks for the explanation. |
We are depending on tensorboard support for keras 3. See tensorflow/tensorboard#6686
We are depending on tensorboard support for keras 3. See tensorflow/tensorboard#6686
We are depending on tensorboard support for keras 3. See tensorflow/tensorboard#6686
We are depending on tensorboard support for keras 3. See tensorflow/tensorboard#6686
We are depending on tensorboard support for keras 3. See tensorflow/tensorboard#6686
This adjusts *_demo.py files to work with Keras 3. The hparams_demo is fully backward compatible with Keras 2 and forward compatible with Keras 3. Unfortunately the graphs_demo is not backward compatible with Keras 2. Users attempting to run it with Keras 2 will get the following error: ``` File "/usr/local/google/home/bdubois/.cache/bazel/_bazel_bdubois/079646a57be11faea0b2bfefccb2a81a/execroot/org_tensorflow_tensorboard/bazel-out/k8-fastbuild/bin/tensorboard/plugins/graph/graphs_demo.runfiles/org_tensorflow_tensorboard/tensorboard/plugins/graph/graphs_demo.py", line 128, in profile tf.summary.trace_on(profiler=True, profiler_outdir=logdir) TypeError: trace_on() got an unexpected keyword argument 'profiler_outdir' ``` Amazingly, though, the graph that the demo generates with Keras 3 can be successfully loaded in the Graph dashboard. This makes me optimistic to get the Graph plugin fully Keras 3 compatible after addressing the user-reported error in #6686. Old Keras 2 Graph: ![image](https://github.com/tensorflow/tensorboard/assets/17152369/b8745739-ac06-4171-a7bc-c97135b2dec7) New Keras 3 Graph: ![image](https://github.com/tensorflow/tensorboard/assets/17152369/04dcaf14-3464-47dc-b4a5-373cccd8370b)
Hi, is there any progress on this issue? Since 2.16, tensorflow and tensorboard are supposed to be keras 3 fully compatible since this is now the default keras installed. It seems that functional keras models cannot still be displayed in graph plugin. (Same error, inbound_nodes list is made of dicts instead of a lists, thus missing the key 0. |
Hi @nhuet, Apologies since we haven't got any bandwidth to work on this issue, will post an update here as soon as there's any update. |
…d tf-keras-nightly (#6823) This should fix the issue described in #6686. Compared the graph content with the one parsed from Keras 3, there are some changes in the structure and naming, this PR modifies the graph parsing accordingly. Googlers, see b/325451531 and b/312739672. Tested with `tensorboard/plugins/graph:graphs_demo`: ![image](https://github.com/tensorflow/tensorboard/assets/15273931/2e13205a-5ea2-437c-9fa7-3198f0eed1c5) #keras3 #oncall
Hi @nhuet, Keras 3 compatibility issue for graph plugin should be fixed at #6823 and #6826. This change will be available in tb-nightly in the next one or two days, please try again and let us know if this resolves your issue. Thanks for your patience! |
…d tf-keras-nightly (tensorflow#6823) This should fix the issue described in tensorflow#6686. Compared the graph content with the one parsed from Keras 3, there are some changes in the structure and naming, this PR modifies the graph parsing accordingly. Googlers, see b/325451531 and b/312739672. Tested with `tensorboard/plugins/graph:graphs_demo`: ![image](https://github.com/tensorflow/tensorboard/assets/15273931/2e13205a-5ea2-437c-9fa7-3198f0eed1c5) #keras3 #oncall
Hi @yatbear! Thanks for these two commits. But I found another issue. Look this notebook, it seems that graph plugin fails when you want to visualize the conceptual graph. In particular for ResNet-152 an error is risen here. [
{
"class_name": "__ellipsis__",
"config": {}
},
2
] In this case, |
When using keras-nightly which is now a preview of the keras 3.0 to come, tensorboard fails to represent the conceptual graph of a functional keras model.
I know that tensorboard is intended to work with the keras of same version, so i put this as a feature request instead of a bug. I tried also with tensorboard-nightly with the same result: sequential models are well represented but not functional models, probably because of a change in json representation. The error comes from "inbound_nodes" which can now be a list of dictionaries/lists instead of a list of lists.
Here is a minimal example showing the bug:
which results in
Here is an extract of the json reprenstation showing that inbound_nodes members are not always lists:
You have to run it in an environment with tensorboard (potentially tb-nightly) and keras-nightly. For instance with:
The text was updated successfully, but these errors were encountered: