Keras: “must compile model before using it” despite compile() is used

前端 未结 4 501
遥遥无期
遥遥无期 2021-01-12 08:15

I want to create and train a CNN model in Keras for classification of banknotes. Creating models works fine with simple tutorials but not with the architecture I adopt from

4条回答
  •  广开言路
    2021-01-12 08:30

    Try This:

    from keras.optimizers import Adam
    opt = keras.optimizers.Adam(use your own learning rate)
    model.compile(optimizer=opt, loss="categorical_crossentropy", metrics=model.compile(optimizer=opt, loss="categorical_crossentropy", metrics=['accuracy']))
    

提交回复
热议问题