{"record":{"id":"64aaec093001a858","repo":"PaddlePaddle/PaddleOCR","slug":"min-pixels-must-be-greater-than-0","errorCode":null,"errorMessage":"min_pixels must be greater than 0.","messagePattern":"min_pixels must be greater than 0\\.","errorType":"validation","errorClass":"InvalidRequestError","httpStatus":null,"severity":"error","filePath":"paddleocr/_api_client/models.py","lineNumber":194,"sourceCode":"            continue\n        if field.name == \"extra_options\":\n            payload.update(value)\n        else:\n            payload[snake_to_camel(field.name)] = value\n    return payload\n\n\ndef _validate_vl_options(options: PaddleOCRVLOptions) -> None:\n    if options.top_p is not None and not (0 < options.top_p <= 1):\n        raise InvalidRequestError(\n            \"top_p must be greater than 0 and less than or equal to 1.\"\n        )\n    if options.temperature is not None and options.temperature < 0:\n        raise InvalidRequestError(\"temperature must be greater than or equal to 0.\")\n    if options.repetition_penalty is not None and options.repetition_penalty <= 0:\n        raise InvalidRequestError(\"repetition_penalty must be greater than 0.\")\n    if options.min_pixels is not None and options.min_pixels <= 0:\n        raise InvalidRequestError(\"min_pixels must be greater than 0.\")\n    if options.max_pixels is not None and options.max_pixels <= 0:\n        raise InvalidRequestError(\"max_pixels must be greater than 0.\")\n    if (\n        options.min_pixels is not None\n        and options.max_pixels is not None\n        and options.min_pixels > options.max_pixels\n    ):\n        raise InvalidRequestError(\"min_pixels cannot be greater than max_pixels.\")\n","sourceCodeStart":176,"sourceCodeEnd":203,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/paddleocr/_api_client/models.py#L176-L203","documentation":"InvalidRequestError raised by _validate_vl_options when PaddleOCRVLOptions.min_pixels is <= 0. min_pixels bounds the minimum processed image size for the VL model and must be a positive pixel count.","triggerScenarios":"PaddleOCRVLOptions(min_pixels=0) or negative; passing a dimension (e.g. 448) where a pixel area is expected, or vice versa producing 0 through unit confusion.","commonSituations":"Tuning image resolution knobs copied from model configs where the value is expressed as pixels = side*side; zero used to mean 'no minimum'.","solutions":["Set min_pixels to a positive integer pixel area","Leave it None for the default","Ensure min_pixels <= max_pixels (a follow-up check enforces this)"],"exampleFix":"# before\noptions = PaddleOCRVLOptions(min_pixels=0)\n# after\noptions = PaddleOCRVLOptions(min_pixels=448 * 448)","handlingStrategy":"validation","validationCode":"if options.min_pixels is not None:\n    assert options.min_pixels > 0, 'min_pixels must be positive pixel area'","typeGuard":null,"tryCatchPattern":"from paddleocr._api_client.errors import InvalidRequestError\n\ntry:\n    run(options)\nexcept InvalidRequestError as e:\n    if 'min_pixels' in str(e):\n        options.min_pixels = None  # fall back to server default\n    else:\n        raise","preventionTips":["Treat pixel options as areas (side*side), not side lengths","Cross-check min <= max before sending"],"tags":["validation","api-client","image-processing"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}