AttributeError: 'InputLayer' object has no attribute 'inbound_nodes'
Asked Answered
C

2

5

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

AttributeError: 'InputLayer' object has no attribute 'inbound_nodes'
Cumings answered 28/1, 2018 at 11:41 Comment(2)
Error seems to come during CoreML conversion. Why not tagged as coreml, too??Moderator
@Moderator addedCumings
L
10

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
Longeron answered 28/1, 2018 at 12:33 Comment(0)
A
0

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.

Antitragus answered 15/5, 2020 at 7:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.