A 'concatenate' Layer Should Be Called On A List Of At Least 2 Inputs
I am trying to implement a conv-net in Keras, where I am planning to separate layers into units for different parametric activation functions, and then recombine these units using
Solution 1:
Rewrite your function like this:
def op(x, units, kernel, stride, activation):
x_list = []
for i in range(units):
x_list.append(L.Conv2D(1, kernel, stride, activation=activation)(x))
x = L.Concatenate(-1)(x_list)
return x
The +=
operator on a list does not do what you think it does, in the end it is kind of concatenating all tensors instead of adding them to a list. Use append
for the intended effect.
Post a Comment for "A 'concatenate' Layer Should Be Called On A List Of At Least 2 Inputs"