Problem in prediction using CNN

517 views
Skip to first unread message

Rajat Awasthi

unread,
Apr 6, 2017, 5:32:11 AM4/6/17
to Keras-users
Hi All, 
   I'm getting error while working on a CNN.
  It's giving me error while I'm running below line in cell-

model.add(Convolution2D(100, (5, 5), padding='valid', input_shape=(1, 32, 32)))

It's giving following error-
 //anaconda/lib/python3.5/site-packages/ipykernel/__main__.py:1: UserWarning: Update your `Conv2D` call to the Keras 2 API: `Conv2D(100, (5, 5), activation="relu", input_shape=(1, 32, 32...)`
  if __name__ == '__main__':
Screen Shot 2017-04-06 at 3.07.19 PM.png

Angad Gill

unread,
Apr 6, 2017, 12:33:21 PM4/6/17
to Rajat Awasthi, Keras-users
Hi Rajat, 

The text in the pink box is a warning. Sounds like you've updated Keras to 2.0! The Convolution2D function is now called Conv2D: https://keras.io/layers/convolutional/#conv2d

The "InvaldArgumentError" error message you saw is cut-off in the screenshot so I don't know what it says. My guess is that your format for the `input_shape` argument is not correct. From the docs:
"""
When using this layer as the first layer in a model, provide the keyword argument input_shape (tuple of integers, does not include the sample axis), e.g. input_shape=(128, 128, 3) for 128x128 RGB pictures in  data_format="channels_last".
"""

Hope this helps!

-Angad

--
You received this message because you are subscribed to the Google Groups "Keras-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to keras-users...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/keras-users/247b2751-e013-458d-828b-3791fe0f48fc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages