keras-team / keras-applications

Reference implementations of popular deep learning models.
Other
2k stars 910 forks source link

Set the default shape for NASNet when `include_top=False` #62

Closed taehoonlee closed 5 years ago

taehoonlee commented 5 years ago

The architectures of NASNetMobile and NASNetLarge differ depending on whether input_shape is even or odd, while the architectures of the other networks are independent to input_shape.

Thus, there are issues (keras-team/keras#10109, keras-team/keras#12013) when using NASNetLarge(weights='imagenet', include_top=False). This is because input_shape becomes (None, None, 3) when include_top=False. The None shape makes the proposed NASNet architecture different.

This PR sets the default shape for NASNet when include_top=False as (224, 224, 3) or (331, 331, 3) by changing require_flatten.