tf.keras.layers.GlobalAveragePooling2D()
tf.keras.layers.GlobalAveragePooling2D(
data_format=None, **kwargs
)
输入参数:
data_format:
输入是一个字符串。“channels_last”(默认) 或者"channels_first"。
channels_last:代表通道数在最后,输入数据的形式是(batch, height, width, channels);
channels_first:代表通道数在前面,输入数据的形式是(batch, channels, height, width);
具体还是根据你在keras使用的图片数据的形式。不需要设置,系统会自动匹配。如果你从未设置过,默认是“channels_last”.
官方英文解释如下:
A string, one of channels_last (default) or channels_first. The ordering of the dimensions in the inputs. channels_last corresponds to inputs with shape (batch, height, width, channels) while channels_fir