{
"error_type": "memory_error",
"description": "内存不足导致推理失败",
"error_patterns": [
"OOM: out of memory during tensor allocation",
"allocate failed: insufficient memory for intermediate tensors",
"memory allocation error: cannot allocate 256MB buffer",
"memory error: GPU memory exhausted",
"cannot allocate memory for model weights"
],
"diagnosis": {
"cause": "模型过大或输入数据batch size过大,超出可用内存限制",
"check_points": [
"模型文件大小是否超过内存容量",
"输入数据的batch size大小",
"是否使用了量化或FP16压缩",
"运行设备(GPU/NPU)的内存/显存大小"
]
},
"suggestions": [
"启用INT8量化重新转换模型以减小模型大小",
"减小输入数据的batch size",
"使用converter_lite的--fp16=on减小模型体积",
"切换到CPU运行避免GPU显存限制"
],
"example_log": "[ERROR] OOM: out of memory during inference. Failed to allocate tensor buffer of size 256MB. Available memory: 128MB. Memory exhausted during layer 'conv_block_5'."
}