NASNet error using custom input shape without top layer
https://github.com/keras-team/keras/blob/07e13740fd181fc3ddec7d9a594d8a08666645f6/keras/applications/nasnet.py#L174-L180

Shouldn't the parameter `require_flatten` uses `include_top` value instead of constant `True`? 
Using `True` makes custom shaped input invalid when using size that isn't the `default_size` with `include_top = False`
Checked several other models such as efficientnet_v2 and xception, they all use `include_top` as value instead of `True`
diff --git a/keras/applications/applications_test.py b/keras/applications/applications_test.py
index 0f99cf07f3..9c2128b366 100644
--- a/keras/applications/applications_test.py
+++ b/keras/applications/applications_test.py
@@ -176,6 +176,16 @@ class ApplicationsTest(tf.test.TestCase, parameterized.TestCase):
             self.assertShapeEqual(output_shape, (None, None, None, last_dim))
         backend.clear_session()
 
+    @parameterized.parameters(*MODEL_LIST)
+    def test_application_notop_custom_input_shape(self, app, last_dim):
+        output_shape = _get_output_shape(
+            lambda: app(
+                weights="imagenet", include_top=False, input_shape=(224, 224, 3)
+            )
+        )
+
+        self.assertEqual(output_shape[-1], last_dim)
+
     @parameterized.parameters(MODEL_LIST)
     def test_application_pooling(self, app, last_dim):
         output_shape = _get_output_shape(
diff --git a/keras/applications/nasnet.py b/keras/applications/nasnet.py
index 99a6604ffd..58295c49a9 100644
--- a/keras/applications/nasnet.py
+++ b/keras/applications/nasnet.py
@@ -188,7 +188,7 @@ def NASNet(
         default_size=default_size,
         min_size=32,
         data_format=backend.image_data_format(),
-        require_flatten=True,
+        require_flatten=include_top,
         weights=weights,
     )
 
['keras/applications/applications_test.py', 'keras/applications/nasnet.py']