Warning from keras: "Update your Conv2D call to the Keras 2 API"

Viewed 6648

I am trying to use keras to create a CNN, but I keep getting this warning which I do not understand how to fix.

Update your Conv2D call to the Keras 2 API: Conv2D(64, (3, 3), activation="relu") after removing the cwd from sys.path.

Can anyone give any ideas about fixing this?

4 Answers

In keras 2

convolution2D is changed into Conv2d or Conv2D

So use:

from keras.layers import Conv2D instead of **from keras.layers import Convolution2D

classifier.add(Conv2D(32,( 3, 3), input_shape = (64, 64, 3), activation = 'relu')) instead of classifier.add(Conv2D(32,3, 3, input_shape = (64, 64, 3), activation = 'relu'))

Your code:

Conv2D(64, (3, 3), activation="relu")

The problem is you have not written kernel_size, i.e

Conv2D(64, kernel_size = (3,3), activation="relu")
Related