Alex Kokorin
Alex Kokorin

Reputation: 469

AttributeError: 'InputLayer' object has no attribute 'inbound_nodes'

I've got the following error: https://pastebin.com/X7146Ury when running this script.

AttributeError: 'InputLayer' object has no attribute 'inbound_nodes'

Upvotes: 5

Views: 7896

Answers (2)

sajed zarrinpour
sajed zarrinpour

Reputation: 1224

I was trying to write a custom layer, the problem was the class which I was subclassing, instead of from tensorflow.keras.layers import Layer, I used

from Keras import layers
class layerName(layers.Layer):
    #impelementation

and it worked.

Upvotes: 0

Matthijs Hollemans
Matthijs Hollemans

Reputation: 7892

In the latest version of Keras this was renamed to _inbound_nodes (note the added underscore). The version of coremltools you're using does not appear to be compatible with that Keras version yet.

However, the latest version on GitHub does appear to use the new _inbound_nodes name. I suggest you install that, using:

pip install -U git+https://github.com/apple/coremltools.git

Upvotes: 10

Related Questions