{"record":{"id":"1851179b21f60744","repo":"keras-team/keras","slug":"if-imagenet-weights-are-being-loaded-depth-multip","errorCode":null,"errorMessage":"If imagenet weights are being loaded, depth multiplier must be 1.  Received depth_multiplier={depth_multiplier}","messagePattern":"If imagenet weights are being loaded, depth multiplier must be 1\\.  Received depth_multiplier=(.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/applications/mobilenet.py","lineNumber":160,"sourceCode":"    input_shape = imagenet_utils.obtain_input_shape(\n        input_shape,\n        default_size=default_size,\n        min_size=32,\n        data_format=backend.image_data_format(),\n        require_flatten=include_top,\n        weights=weights,\n    )\n\n    if backend.image_data_format() == \"channels_last\":\n        row_axis, col_axis = (0, 1)\n    else:\n        row_axis, col_axis = (1, 2)\n    rows = input_shape[row_axis]\n    cols = input_shape[col_axis]\n\n    if weights == \"imagenet\":\n        if depth_multiplier != 1:\n            raise ValueError(\n                \"If imagenet weights are being loaded, \"\n                \"depth multiplier must be 1.  \"\n                f\"Received depth_multiplier={depth_multiplier}\"\n            )\n\n        if alpha not in [0.25, 0.50, 0.75, 1.0]:\n            raise ValueError(\n                \"If imagenet weights are being loaded, \"\n                \"alpha can be one of\"\n                \"`0.25`, `0.50`, `0.75` or `1.0` only.  \"\n                f\"Received alpha={alpha}\"\n            )\n\n        if rows != cols or rows not in [128, 160, 192, 224]:\n            rows = 224\n            warnings.warn(\n                \"`input_shape` is undefined or non-square, \"\n                \"or `rows` is not in [128, 160, 192, 224]. \"","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/applications/mobilenet.py#L142-L178","documentation":"Error \"If imagenet weights are being loaded, depth multiplier must be 1.  Received depth_multiplier={depth_multiplier}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/applications/mobilenet.py:160 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7a34a03db60bf60042242d6a556fc3be119046a5","analyzedAt":"2026-08-25T21:25:25.994Z","schemaVersion":2},"datasetVersion":"2026-08-26T02:17:13.382Z"}