I am using python 3 with anaconda, and keras with over tensorflow, My goal is to create a network with a Conv layer of variable input size
I found here to use this code
i = Input((None, None, 1))
o = Conv2D(1, 3, 3)(i)
model = Model(i, o)
model.compile('sgd', 'mse')
I have used it to create my own model with this code (I need a flatten layer)
model = Sequential()
I = Input((None, None, 1))
c = Conv2D(filters=1, kernel_size=(1, 1))(I)
f = Flatten()(c)
o = Dense(10, activation="softmax")(f)
m = Model(I, o)
m.compile(loss=categorical_crossentropy, optimizer=SGD(), metrics=["accuracy"])
And I keep getting this error
ValueError: The shape of the input to "Flatten" is not fully defined (got (None, None, 1). Make sure to pass a complete "input_shape" or "batch_input_shape" argument to the first layer in your model.
Seems like the issue is with the input shape for the Flatten layer, When I remove it, it's fine.
How can I make it play well with the variable size?
Thanks