{"record":{"id":"e2a2e6e013427d9a","repo":"tensorflow/models","slug":"only-1-crop-and-3-crop-are-supported-found-num-c","errorCode":null,"errorMessage":"Only 1-crop and 3-crop are supported. Found {num_crops!r}.","messagePattern":"Only 1-crop and 3-crop are supported\\. Found (.+?)\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"official/vision/ops/preprocess_ops_3d.py","lineNumber":307,"sourceCode":"          false_fn=lambda: tf.broadcast_to([\n              0, 0, tf.cast(width, tf.float32) / 2 - target_width // 2, 0\n          ], [4]))\n      offset_3 = tf.cond(\n          tf.greater_equal(height, width),\n          true_fn=lambda: tf.broadcast_to(\n              [0, tf.cast(height, tf.float32) - target_height, 0, 0], [4]),\n          false_fn=lambda: tf.broadcast_to(\n              [0, 0, tf.cast(width, tf.float32) - target_width, 0], [4]))\n      # pylint:disable=g-long-lambda\n\n      crops = []\n      for offset in [offset_1, offset_2, offset_3]:\n        offset = tf.cast(tf.math.round(offset), tf.int32)\n        crops.append(tf.slice(frames, offset, size))\n      frames = tf.concat(crops, axis=0)\n\n    else:\n      raise NotImplementedError(\n          f\"Only 1-crop and 3-crop are supported. Found {num_crops!r}.\")\n\n  return frames\n\n\ndef resize_smallest(frames: tf.Tensor, min_resize: int) -> tf.Tensor:\n  \"\"\"Resizes frames so that min(`height`, `width`) is equal to `min_resize`.\n\n  This function will not do anything if the min(`height`, `width`) is already\n  equal to `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\n  Returns:\n    A Tensor of shape [timesteps, output_h, output_w, channels] of type\n      frames.dtype where min(output_h, output_w) = min_resize.","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/ops/preprocess_ops_3d.py#L289-L325","documentation":"Error \"Only 1-crop and 3-crop are supported. Found {num_crops!r}.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/ops/preprocess_ops_3d.py:307 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set num_crops to 1 or 3.","Remove num_crops to use the default single-crop behavior."],"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"}