I am using following code:
input_shape = (75, 75, 3)
x = Input(input_shape)
model = BatchNormalization(axis = 3)(x)
Above code works all right. However, following code does not work:
from keras.models import Sequential
input_shape = (64,64,3)
model = Sequential()
model = model.add(InputLayer(input_shape=input_shape))
model = model.add(BatchNormalization(axis = 3))
But at last line, I get error:
AttributeError: 'NoneType' object has no attribute 'add'
If I change to:
model = model.add(Input(input_shape))
I get following error:
TypeError: The added layer must be an instance of class Layer.
Found: Tensor("input_1:0", shape=(?, 64, 64, 3), dtype=float32)
Where is the problem and how can it be solved?
(PS: If you find this question to be interesting/important, please upvote it.)