logo
Loading...

建立keras model出現This model has not yet been built. Build the model first by calling `build()` or calling `fit()` with some data, or specify an `input_shape` argument in the first layer(s) for automatic build 錯誤 - Cupoy

在HW11內的程式碼,如下: classifier = Sequential()classifier...

建立keras model出現This model has not yet been built. Build the model first by calling `build()` or calling `fit()` with some data, or specify an `input_shape` argument in the first layer(s) for automatic build 錯誤

2019/12/10 05:29 AM
電腦視覺深度學習論壇
王政雲
觀看數:0
回答數:2
收藏數:0

在HW11內的程式碼,如下: 

classifier = Sequential()

classifier.add(Convolution2D(filters = (3,3),kernel_size =32))


print(classifier.summary())

# 下列會無法執行,回出現錯誤,想問一下這一行是不適寫錯了,看錯誤法需要先call  build() fit() 才會建立模型。

ValueError: This model has not yet been built. Build the model first by calling `build()` or calling `fit()` with some data, or specify an `input_shape` argument in the first layer(s) for automatic build.