Negative dimension size caused by subtracting 3 from 1 for 'conv2d_2/convolution'

后端 未结 6 1705
情书的邮戳
情书的邮戳 2020-12-14 02:33

I got this error message when declaring the input layer in Keras.

ValueError: Negative dimension size caused by subtracting 3 from 1 for \'conv2d_2/

6条回答
  •  执笔经年
    2020-12-14 03:17

    Keras is available with following backend compatibility:

    TensorFlow : By google, Theano : Developed by LISA lab, CNTK : By Microsoft

    Whenever you see a error with [?,X,X,X], [X,Y,Z,X], its a channel issue to fix this use auto mode of Keras:

    Import

    from keras import backend as K
    K.set_image_dim_ordering('th')
    

    "tf" format means that the convolutional kernels will have the shape (rows, cols, input_depth, depth)

    This will always work ...

提交回复
热议问题