keras-team/keras · error · ValueError
If imagenet weights are being loaded, alpha can be one of…
Error message
If imagenet weights are being loaded, alpha can be one of `0.75`, `1.0` for non minimalistic or `1.0` for minimalistic only.
What it means
MobileNetV3 builder in keras/src/applications/mobilenet_v3.py: pretrained ImageNet checkpoints exist only for alpha=0.75 and alpha=1.0 in the standard (non-minimalistic) variant, and only alpha=1.0 for the minimalistic variant. Other alpha values change the channel widths and cannot match the stored weights.
Solutions
- Use alpha=0.75 or 1.0 (non-minimalistic) or alpha=1.0 (minimalistic) with imagenet weights
- Set weights=None to train an arbitrary alpha from scratch
- If you need smaller models, use the 0.75 width variant rather than an unsupported alpha
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at keras/src/applications/mobilenet_v3.py:277 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of keras-team/keras@7a34a03db6 (2026-08-25).
Data as JSON: /api/errors/2f01c1062e796df6.
Report an issue: GitHub.
Appendix: source
Thrown at keras/src/applications/mobilenet_v3.py:277
if backend.image_data_format() == "channels_last":
row_axis, col_axis = (0, 1)
else:
row_axis, col_axis = (1, 2)
rows = input_shape[row_axis]
cols = input_shape[col_axis]
if rows and cols and (rows < 32 or cols < 32):
raise ValueError(
"Input size must be at least 32x32; Received `input_shape="
f"{input_shape}`"
)
if weights == "imagenet":
if (
not minimalistic
and alpha not in [0.75, 1.0]
or minimalistic
and alpha != 1.0
):
raise ValueError(
"If imagenet weights are being loaded, "
"alpha can be one of `0.75`, `1.0` for non minimalistic "
"or `1.0` for minimalistic only."
)
if rows != cols or rows != 224:
warnings.warn(
"`input_shape` is undefined or non-square, "
"or `rows` is not 224. "
"Weights for input shape (224, 224) will be "
"loaded as the default.",
stacklevel=2,
)
if input_tensor is None:
img_input = layers.Input(shape=input_shape)
else:
if not backend.is_keras_tensor(input_tensor):View on GitHub (pinned to 7a34a03db6)