Skip to content
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

Exception with Tensorflow 2.16 #217

Closed
jonnor opened this issue Mar 29, 2024 · 2 comments
Closed

Exception with Tensorflow 2.16 #217

jonnor opened this issue Mar 29, 2024 · 2 comments

Comments

@jonnor
Copy link
Contributor

jonnor commented Mar 29, 2024

Hi, I tested NNoM with the latest Tensorflow/Keras 2.x, currently at version 2.16.1

I ran the auto_test example. On TF 2.16.1 I get the following exception:

Traceback (most recent call last):
  File "/home/jon/projects/embeddedml/handson/nnom-models/nnom/examples/auto_test/main.py", line 162, in <module>
    main()
  File "/home/jon/projects/embeddedml/handson/nnom-models/nnom/examples/auto_test/main.py", line 134, in main
    scores = evaluate_model(model, x_test, y_test)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/jon/projects/embeddedml/handson/nnom-models/nnom/scripts/nnom.py", line 1098, in evaluate_model
    bs = model.input.shape[0]
         ^^^^^^^^^^^^^^^^^
AttributeError: 'list' object has no attribute 'shape'

I then tried older versions, and they do not have this issue.

TF 2.12.1 - works
TF 2.14.1 - works

Hope this information can be useful to someone else :)

@jonnor
Copy link
Contributor Author

jonnor commented Mar 30, 2024

I tried replacing all instances of model.input with model.input[0], and layer.inbound_nodes with layer._inbound_nodes. Then get exception AttributeError: 'Node' object has no attribute 'inbound_layers' which I did not immediately find an obvious fix for. So there is some work needed for Tensorflow 2.16 compatibility

@jonnor
Copy link
Contributor Author

jonnor commented Mar 30, 2024

Ah, I see now that Tensorflow 2.16 pulls in Keras 3.x. So this is duplicate of #214

@jonnor jonnor closed this as completed Mar 30, 2024
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

No branches or pull requests

1 participant