{
  "id": "tensorflow/internal-error-cudnn-rnn-init",
  "signature": "InternalError: cuDNN RNN initialization failed: CUDNN_STATUS_BAD_PARAM",
  "signature_zh": "内部错误：cuDNN RNN初始化失败：CUDNN_STATUS_BAD_PARAM",
  "regex": "InternalError: cuDNN RNN initialization failed: CUDNN_STATUS_BAD_PARAM",
  "domain": "tensorflow",
  "category": "gpu_error",
  "subcategory": null,
  "root_cause": "cuDNN RNN layer initialization fails due to unsupported hidden size, batch size, or sequence length for the given cuDNN version.",
  "root_cause_type": "generic",
  "root_cause_zh": "cuDNN RNN层初始化失败，原因是给定cuDNN版本不支持的隐藏大小、批大小或序列长度。",
  "versions": [
    {
      "version": "tensorflow 2.14.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "cudnn 8.9.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The error is about invalid parameters, not memory.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Older cuDNN versions may not support required RNN operations.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Reduce the hidden size or batch size to a value supported by cuDNN (e.g., hidden size divisible by 32 or 64):\nmodel.add(tf.keras.layers.LSTM(units=256, return_sequences=True))\n# Try units=128 or 64 if 256 fails",
      "success_rate": 0.8,
      "how": "Reduce the hidden size or batch size to a value supported by cuDNN (e.g., hidden size divisible by 32 or 64):\nmodel.add(tf.keras.layers.LSTM(units=256, return_sequences=True))\n# Try units=128 or 64 if 256 fails",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set the environment variable TF_CUDNN_USE_AUTOTUNE=0 to disable cuDNN autotuning, which may bypass the BAD_PARAM error:\nexport TF_CUDNN_USE_AUTOTUNE=0\npython train.py",
      "success_rate": 0.7,
      "how": "Set the environment variable TF_CUDNN_USE_AUTOTUNE=0 to disable cuDNN autotuning, which may bypass the BAD_PARAM error:\nexport TF_CUDNN_USE_AUTOTUNE=0\npython train.py",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Reduce the hidden size or batch size to a value supported by cuDNN (e.g., hidden size divisible by 32 or 64):\nmodel.add(tf.keras.layers.LSTM(units=256, return_sequences=True))\n# Try units=128 or 64 if 256 fails",
    "Set the environment variable TF_CUDNN_USE_AUTOTUNE=0 to disable cuDNN autotuning, which may bypass the BAD_PARAM error:\nexport TF_CUDNN_USE_AUTOTUNE=0\npython train.py"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.tensorflow.org/api_docs/python/tf/keras/layers/LSTM",
  "official_doc_section": null,
  "error_code": "ICR",
  "verification_tier": "ai_generated",
  "confidence": 0.83,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2024-03-10",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}