# Why this sequential model is not starting?

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()


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.)

• I feel you. I am watching a tutorial by Janis Seeman, that probably is deprecated. In dhtis tutorial he uses the same commands. I have to work on my master thesis and this whole ....... does not work. Iam kind of frustrated as f... They do not knwo Sequential() anymore, and most of those commands are "deprecated". That is what the error message contains. – Diane Wagner Oct 8 at 4:29

from keras.models import Sequential

• No! This does not work. I have already put a statement at beginning: from keras.models import Sequential, Model. Replacing that with from keras import models and using models.Sequential() also gives same error. I am editing my question above to add this statement. – rnso Sep 29 '18 at 1:48
• Yes, it has to be just model.add(... and not model = model.add(... – rnso Sep 29 '18 at 12:29