{"record":{"id":"e2448c9aeeb9700e","repo":"apache/beam","slug":"vertex-ai-does-not-support-custom-dimensions-for-video-input","errorCode":null,"errorMessage":"Vertex AI does not support custom dimensions for video input, want dimension = 1408, got ","messagePattern":"Vertex AI does not support custom dimensions for video input, want dimension = 1408, got ","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/ml/transforms/embeddings/vertex_ai.py","lineNumber":497,"sourceCode":"        If submitting video content, dimension *musst* be 1408.\n      project: The default GCP project for API calls.\n      location: The default location for API calls.\n      credentials: Custom credentials for API calls.\n        Defaults to environment credentials.\n    \"\"\"\n    self.model_name = model_name\n    self.project = project\n    self.location = location\n    self.credentials = credentials\n    self.kwargs = kwargs\n    if dimension is not None and dimension not in (128, 256, 512, 1408):\n      raise ValueError(\n          \"dimension argument must be one of 128, 256, 512, or 1408\")\n    self.dimension = dimension\n    if not image_column and not video_column and not text_column:\n      raise ValueError(\"at least one input column must be specified\")\n    if video_column is not None and dimension != 1408:\n      raise ValueError(\n          \"Vertex AI does not support custom dimensions for video input, want dimension = 1408, got \",\n          dimension)\n    self.type_adapter = _create_multimodal_dict_adapter(\n        image_column=image_column,\n        video_column=video_column,\n        text_column=text_column)\n    super().__init__(type_adapter=self.type_adapter, **kwargs)\n\n  def get_model_handler(self) -> ModelHandler:\n    return _VertexAIMultiModalEmbeddingHandler(\n        model_name=self.model_name,\n        dimension=self.dimension,\n        project=self.project,\n        location=self.location,\n        credentials=self.credentials,\n        **self.kwargs)\n\n  def get_ptransform_for_processing(self, **kwargs) -> beam.PTransform:","sourceCodeStart":479,"sourceCodeEnd":515,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/ml/transforms/embeddings/vertex_ai.py#L479-L515","documentation":"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.","triggerScenarios":"Constructing the multimodal handler with video_column='vid' and dimension=128/256/512 (or None handling differing from 1408).","commonSituations":"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.","solutions":["Set dimension=1408 when a video_column is present.","Remove video_column if you need reduced dimensions and only embed images/text.","Split the pipeline: video embeddings at 1408 in one handler, reduced-dim image/text in another."],"exampleFix":"// before\nhandler = MultimodalHandler(video_column='vid', dimension=512)\n// after\nhandler = MultimodalHandler(video_column='vid', dimension=1408)","handlingStrategy":"validation","validationCode":"if video_column is not None and dimension != 1408:\n    raise ValueError('video input requires dimension=1408')","typeGuard":null,"tryCatchPattern":"try:\n    handler = MultimodalHandler(video_column='vid', dimension=dim)\nexcept ValueError as e:\n    if 'video' in str(e):\n        handler = MultimodalHandler(video_column='vid', dimension=1408)","preventionTips":["Video embeddings are fixed at 1408 dims on Vertex AI","Validate dimension/column combos early"],"tags":["python","vertex-ai","embeddings","validation","video"],"backgroundTag":"invalid-argument-value","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}