model = sequential ()
model.add(convolutional2D(32,3,3 , input_shape = (img_width,
img_height,3))
model.add(Maxpooling2D(pool_size=(2,2)))
model.add(Activation('relu'))
model.add(convolutional2D(32,3,3))
model.add(Activation('relu'))
model.add(MaxpoolingD2(pooling_size=(2,2)))
model.add(convolutional2D(32,3,3,))
model.add(Activation('relu'))
model.add(Maxpooling2D(pooling_size=(2,2)))
model.add(Flatten())
model.add(dense(64))
model.add(Activation('relu'))
model.add(dropout(0.5))
model.add(dense(1))
model.add(activation(sigmoid))
请某人应该帮忙。我在python 2.7环境中使用jupyter notebook,上面的代码返回:
File "<ipython-input-11-fab080993955>", line 4
model.add(Activation('relu'))
^
SyntaxError:语法无效
可能是什么问题?
答案 0 :(得分:1)
您在此行末尾缺少一个括号:
model.add(convolutional2D(32,3,3 , input_shape = (img_width, img_height,3))