{"record":{"id":"5c42c48d1753858b","repo":"tensorflow/models","slug":"if-is-flow-frames-should-be-given-in-tf-float3","errorCode":null,"errorMessage":"If `is_flow`, frames should be given in `tf.float32`.","messagePattern":"If `is_flow`, frames should be given in `tf\\.float32`\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/projects/videoglue/datasets/common/processors.py","lineNumber":336,"sourceCode":"  `min_resize`. This allows to save compute time.\n\n  Args:\n    frames: A tensor of dimension [timesteps, input_h, input_w, channels].\n    min_resize: Minimum size of the final image dimensions.\n    is_flow: If is flow, will modify the raw values to account for the resize.\n      For example, if the flow image is resized by a factor k, we need to\n      multiply the flow values by the same factor k since one pixel displacement\n      in the resized image corresponds to only 1/k pixel displacement in the\n      original image.\n    state: A mutable dictionary passed to the stateful functions and might be\n      modified in order to keep metadata.\n\n  Returns:\n    A tensor of shape [timesteps, output_h, output_w, channels] of same type as\n    input, where `min(output_h, output_w)` is `min_resize`.\n  \"\"\"\n  if is_flow and frames.dtype != tf.float32:\n    raise ValueError('If `is_flow`, frames should be given in `tf.float32`.')\n  shape = tf.shape(input=frames)\n  input_h = shape[1]\n  input_w = shape[2]\n\n  output_h = tf.maximum(min_resize, (input_h * min_resize) // input_w)\n  output_w = tf.maximum(min_resize, (input_w * min_resize) // input_h)\n\n  def resize_fn():\n    \"\"\"Bilinear resize function wrapper.\"\"\"\n    frames_resized = tf.image.resize(\n        frames, (output_h, output_w), method=tf.image.ResizeMethod.BILINEAR)\n    return tf.cast(frames_resized, frames.dtype)\n\n  should_resize = tf.math.logical_or(tf.not_equal(input_w, output_w),\n                                     tf.not_equal(input_h, output_h))\n  frames = tf.cond(\n      pred=should_resize, true_fn=resize_fn, false_fn=lambda: frames)\n","sourceCodeStart":318,"sourceCodeEnd":354,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/videoglue/datasets/common/processors.py#L318-L354","documentation":"Error \"If `is_flow`, frames should be given in `tf.float32`.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/videoglue/datasets/common/processors.py:336 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"}