{"record":{"id":"a0b5f23f877a4551","repo":"keras-team/keras","slug":"invalid-data-format-argument-data-format-a0b5f2","errorCode":null,"errorMessage":"Invalid `data_format` argument: {data_format}","messagePattern":"Invalid `data_format` argument: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"keras/src/legacy/backend.py","lineNumber":1357,"sourceCode":"    x_rep = tf.reshape(x_rep, x_shape)\n\n    # Fix shape representation\n    x_shape = x.shape.as_list()\n    x_rep.set_shape(x_shape)\n    return x_rep\n\n\n@keras_export(\"keras._legacy.backend.resize_images\")\ndef resize_images(\n    x, height_factor, width_factor, data_format, interpolation=\"nearest\"\n):\n    \"\"\"DEPRECATED.\"\"\"\n    if data_format == \"channels_first\":\n        rows, cols = 2, 3\n    elif data_format == \"channels_last\":\n        rows, cols = 1, 2\n    else:\n        raise ValueError(f\"Invalid `data_format` argument: {data_format}\")\n\n    new_shape = x.shape[rows : cols + 1]\n    if new_shape.is_fully_defined():\n        new_shape = tf.constant(new_shape.as_list(), dtype=\"int32\")\n    else:\n        new_shape = tf.shape(x)[rows : cols + 1]\n    new_shape *= tf.constant(\n        np.array([height_factor, width_factor], dtype=\"int32\")\n    )\n\n    if data_format == \"channels_first\":\n        x = permute_dimensions(x, [0, 2, 3, 1])\n    interpolations = {\n        \"area\": tf.image.ResizeMethod.AREA,\n        \"bicubic\": tf.image.ResizeMethod.BICUBIC,\n        \"bilinear\": tf.image.ResizeMethod.BILINEAR,\n        \"gaussian\": tf.image.ResizeMethod.GAUSSIAN,\n        \"lanczos3\": tf.image.ResizeMethod.LANCZOS3,","sourceCodeStart":1339,"sourceCodeEnd":1375,"githubUrl":"https://github.com/keras-team/keras/blob/7a34a03db60bf60042242d6a556fc3be119046a5/keras/src/legacy/backend.py#L1339-L1375","documentation":"Error \"Invalid `data_format` argument: {data_format}\" thrown in keras-team/keras.","triggerScenarios":"Thrown at keras/src/legacy/backend.py:1357 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"}