Closed LinzzMichael closed 5 years ago
You'll need to change the Keras variable "image_data_format" to "channels_first". You can do this in two ways:
Change it in your keras.json configuration file (https://keras.io/backend/#switching-from-one-backend-to-another)
Include the following two lines at the top of your code
from tensorflow.keras import backend as K
K.set_image_data_format('channels_first')
Thank you for your answer, it' my mistake not see your introduction, I had run the code successfully now.
Good to hear. Let me know if there are any other issues.
Hi, good to hear that you have fixed the problem. However, I encountered the same problem, can you share your method about fixing it?
The solution above should still work. Put these two lines at the top of your code.
from tensorflow.keras import backend as K
K.set_image_data_format('channels_first')
when I run the code, I got the error "Negative dimension size caused by subtracting 64 from 1 for 'depthwise_conv2d/depthwise' (op: 'DepthwiseConv2dNative') with input shapes: [?,1,64,8], [64,1,8,2]." and I found it's not caused by my dataset, it's caused by the DepthwiseConv2D operate in line 139.