I'm implementing a ConvRNN in keras, and the implementation follows this which is originally implemented in Pytorch.
When the class ConvRNN is going to return a keras Model(inputs, outputs), then an error occurs:
AttributeError: 'NoneType' object has no attribute '_inbound_nodes'
Anyway, I re-checked my code and finally located the code which triggers the problem.But I don't know how to modify it. They are:
one = keras.backend.ones_like(z)
h_output = keras.layers.add([keras.layers.multiply([keras.layers.subtract([one, z]), h]), keras.layers.multiply([z, n])]) # h = (1 - z) * h + z * n
# h, z and n are all keras tensors
What I want to implement here is h = (1 - z) * h + z * n.
Can anyone please give me advice? Thanks in advance.
BTW, the keras version is 2.3.1 and the tensorflow version is 1.14.0.