{
  "id": "tensorflow/unknown-model-save-format",
  "signature": "ValueError: Unknown model format: 'h5'. Supported formats: 'tf', 'keras'",
  "signature_zh": "值错误：未知模型格式 'h5'。支持的格式：'tf', 'keras'",
  "regex": "ValueError.*Unknown model format.*Supported formats.*tf.*keras",
  "domain": "tensorflow",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "Saving a model with .h5 extension is not supported in TF2's default save format; only SavedModel or Keras native format is allowed.",
  "root_cause_type": "generic",
  "root_cause_zh": "在TF2默认保存格式中不支持使用.h5扩展名保存模型；只允许SavedModel或Keras原生格式。",
  "versions": [
    {
      "version": "tensorflow 2.13.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "tensorflow 2.14.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Renaming file extension to .tf doesn't change underlying format.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Installing h5py doesn't add .h5 support to TF2 save API.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use model.save('my_model.keras') with the native Keras format.",
      "success_rate": 0.95,
      "how": "Use model.save('my_model.keras') with the native Keras format.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use model.save('my_model', save_format='tf') for SavedModel format.",
      "success_rate": 0.9,
      "how": "Use model.save('my_model', save_format='tf') for SavedModel format.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Explicitly set save_format='h5' in model.save() to force HDF5: model.save('my_model.h5', save_format='h5')",
      "success_rate": 0.85,
      "how": "Explicitly set save_format='h5' in model.save() to force HDF5: model.save('my_model.h5', save_format='h5')",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Use model.save('my_model.keras') with the native Keras format.",
    "Use model.save('my_model', save_format='tf') for SavedModel format.",
    "Explicitly set save_format='h5' in model.save() to force HDF5: model.save('my_model.h5', save_format='h5')"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.tensorflow.org/guide/keras/save_and_serialize",
  "official_doc_section": null,
  "error_code": "MSF",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}