in SqueezeAndExcitation function (tensorflow version) it should be x = GlobalAveragePooling2D(**keepdims=True**)(inputs)