Exception with Tensorflow 2.16
jonnor opened this issue · 2 comments
jonnor commented
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 commented
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