MachineLearning icon indicating copy to clipboard operation
MachineLearning copied to clipboard

The first layer in a Sequential model must get an `input_shape` or `batch_input_shape` argument.

Open cliff007 opened this issue 9 years ago • 2 comments

Traceback (most recent call last): File "D:/cliff/Programmer-related/GPU_related/kerasѧϰ/dive_into_keras/cnn.py", line 62, in model = create_model() File "D:/cliff/Programmer-related/GPU_related/kerasѧϰ/dive_into_keras/cnn.py", line 38, in create_model model.add(Convolution2D(4, 1, 5, 5, border_mode='valid')) # cliff, add "input_shape" File "C:\Anaconda2\lib\site-packages\keras\models.py", line 106, in add raise Exception('The first layer in a Sequential model must ' Exception: The first layer in a Sequential model must get an input_shape or batch_input_shape argument.

cliff007 avatar Jun 06 '16 01:06 cliff007

最新版本keras的函数接口有一些变化,已更新

wepe avatar Jun 06 '16 08:06 wepe

then what should to fix the code !

guozilei2010 avatar Mar 27 '17 00:03 guozilei2010