简体   繁体   中英

can I use conv2d with input dimension not fixed?

i am new in tensorflow i have a question: Can i put in my conv2d an input with shape not fixed? inputs.shape =(?, 1568) when i train my neural network i get this message: raise ValueError(f'Input {input_index} of layer "{layer_name}" ' ValueError: Input 0 of layer "conv2d" is incompatible with the layer: expected min_ndim=4, found ndim=2. Full shape received: (Dimension(None), Dimension(1568)) my con2d layer is like this: x = Conv2D(32, (3,3), padding="same",input_shape=input_shape[1:])(inputs)

I resolved that by using: tf.expand_dims

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM