{"record":{"id":"9427ac61ceb800bf","repo":"tensorflow/models","slug":"max-resize-should-not-be-larger-than-pad-size-got","errorCode":null,"errorMessage":"max_resize should not be larger than pad_size. Got ({max_resize}, {pad_size}).","messagePattern":"max_resize should not be larger than pad_size\\. Got \\((.+?), (.+?)\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/videoglue/datasets/common/processors.py","lineNumber":513,"sourceCode":"    pad_size: int,\n    random: bool = False,\n    seed: Optional[int] = None,\n    state: Optional[MutableMapping[str, tf.Tensor]] = None) -> tf.Tensor:\n  \"\"\"Resizes the largest and pads frames.\n\n  Args:\n    frames: A Tensor of dimension [timesteps, input_h, input_w, channels].\n    max_resize: Maximum size of the final image dimensions.\n    pad_size: Pad size of the final image dimensions.\n    random: If true, perform random crop; otherwise, perform central crop.\n    seed: Random seed.\n    state: The dictionary contains random state.\n  Returns:\n    A Tensor of shape [timesteps, output_h, output_w, channels] of type\n      frames.dtype where min(output_h, output_w) = max_resize.\n  \"\"\"\n  if max_resize > pad_size:\n    raise ValueError('max_resize should not be larger than pad_size. Got '\n                     f'({max_resize}, {pad_size}).')\n\n  pad_color = tf.reduce_mean(frames, axis=[0, 1, 2])\n\n  shape = tf.shape(input=frames)\n  image_size = tf.cast(shape[1:3], tf.float32)\n  input_h = image_size[0]\n  input_w = image_size[1]\n\n  scale = tf.cast(max_resize / input_h, tf.float32)\n  scale = tf.minimum(scale, tf.cast(max_resize / input_w, tf.float32))\n\n  scale_h = input_h * scale\n  scale_w = input_w * scale\n\n  frames_resized = tf.image.resize(\n      frames, (scale_h, scale_w), method=tf.image.ResizeMethod.BILINEAR)\n  frames = tf.cast(frames_resized, frames.dtype)","sourceCodeStart":495,"sourceCodeEnd":531,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/videoglue/datasets/common/processors.py#L495-L531","documentation":"Error \"max_resize should not be larger than pad_size. Got ({max_resize}, {pad_size}).\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/videoglue/datasets/common/processors.py:513 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":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}