apache/beam · error · ValueError

Vertex AI does not support custom dimensions for video…

Error message

Vertex AI does not support custom dimensions for video input, want dimension = 1408, got 

What it means

Vertex AI's multimodal embedding model produces fixed 1408-dim vectors for video input and does not allow custom (reduced) dimensions for video. Supplying a video_column with dimension != 1408 raises ValueError with the expected vs got values.

Solutions

  1. Set dimension=1408 when a video_column is present.
  2. Remove video_column if you need reduced dimensions and only embed images/text.
  3. Split the pipeline: video embeddings at 1408 in one handler, reduced-dim image/text in another.

Example fix

// before
handler = MultimodalHandler(video_column='vid', dimension=512)
// after
handler = MultimodalHandler(video_column='vid', dimension=1408)
Defensive patterns

Strategy: validation

Validate before calling

if video_column is not None and dimension != 1408:
    raise ValueError('video input requires dimension=1408')

Try / catch

try:
    handler = MultimodalHandler(video_column='vid', dimension=dim)
except ValueError as e:
    if 'video' in str(e):
        handler = MultimodalHandler(video_column='vid', dimension=1408)

Prevention

When it happens

Trigger: Constructing the multimodal handler with video_column='vid' and dimension=128/256/512 (or None handling differing from 1408).

Common situations: Wanting smaller video embeddings to save storage like you can with image/text; copying an image handler config that uses dimension=512 and adding a video column.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/e2448c9aeeb9700e. Report an issue: GitHub.

Appendix: source

Thrown at sdks/python/apache_beam/ml/transforms/embeddings/vertex_ai.py:497

        If submitting video content, dimension *musst* be 1408.
      project: The default GCP project for API calls.
      location: The default location for API calls.
      credentials: Custom credentials for API calls.
        Defaults to environment credentials.
    """
    self.model_name = model_name
    self.project = project
    self.location = location
    self.credentials = credentials
    self.kwargs = kwargs
    if dimension is not None and dimension not in (128, 256, 512, 1408):
      raise ValueError(
          "dimension argument must be one of 128, 256, 512, or 1408")
    self.dimension = dimension
    if not image_column and not video_column and not text_column:
      raise ValueError("at least one input column must be specified")
    if video_column is not None and dimension != 1408:
      raise ValueError(
          "Vertex AI does not support custom dimensions for video input, want dimension = 1408, got ",
          dimension)
    self.type_adapter = _create_multimodal_dict_adapter(
        image_column=image_column,
        video_column=video_column,
        text_column=text_column)
    super().__init__(type_adapter=self.type_adapter, **kwargs)

  def get_model_handler(self) -> ModelHandler:
    return _VertexAIMultiModalEmbeddingHandler(
        model_name=self.model_name,
        dimension=self.dimension,
        project=self.project,
        location=self.location,
        credentials=self.credentials,
        **self.kwargs)

  def get_ptransform_for_processing(self, **kwargs) -> beam.PTransform:

View on GitHub (pinned to 12126d8942)