keras-applications icon indicating copy to clipboard operation
keras-applications copied to clipboard

efficientnet SE modual meet backend.image_data_format trouble

Open ZJQbelief opened this issue 6 years ago • 0 comments

https://github.com/keras-team/keras-applications/blob/976050c468ff949bcbd9b9cf64fe1d5c81db3f3a/keras_applications/efficientnet.py#L175

This code will meet trouble when backend.image_data_format() == "channels_first". It should be change as below:

if backend.image_data_format() == 'channels_last':
       se = layers.Reshape((1, 1, filters), name=name + 'se_reshape')(se)
else:
       se = layers.Reshape((filters, 1, 1), name=name + 'se_reshape')(se)

Thank for your working!

ZJQbelief avatar Nov 29 '19 07:11 ZJQbelief