wepe / MachineLearning

Basic Machine Learning and Deep Learning
5.25k stars 3.17k forks source link

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

Open cliff007 opened 8 years ago

cliff007 commented 8 years ago

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.

wepe commented 8 years ago

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

guozilei2010 commented 7 years ago

then what should to fix the code !