{"record":{"id":"03ac713c398cda1e","repo":"sgl-project/sglang","slug":"camera-conditions-must-have-last-dimension-20-got","errorCode":null,"errorMessage":"camera_conditions must have last dimension 20, got {tuple(camera_conditions.shape)}","messagePattern":"camera_conditions must have last dimension 20, got (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/base.py","lineNumber":1888,"sourceCode":"                else torch.as_tensor(camera_conditions)\n            ).to(device=device, dtype=camera_compute_dtype)\n            if camera_conditions.dim() == 2:\n                camera_conditions = camera_conditions.unsqueeze(0)\n            if camera_conditions.dim() != 3:\n                raise ValueError(\n                    \"camera_conditions must have shape (T,20) or (B,T,20), \"\n                    f\"got {tuple(camera_conditions.shape)}\"\n                )\n            if camera_conditions.shape[0] == 1 and batch_size > 1:\n                camera_conditions = camera_conditions.expand(batch_size, -1, -1)\n            if camera_conditions.shape[0] != batch_size:\n                raise ValueError(\n                    \"camera_conditions batch dimension must be 1 or match \"\n                    f\"request batch size {batch_size}, got \"\n                    f\"{camera_conditions.shape[0]}.\"\n                )\n            if camera_conditions.shape[-1] != 20:\n                raise ValueError(\n                    \"camera_conditions must have last dimension 20, got \"\n                    f\"{tuple(camera_conditions.shape)}\"\n                )\n            if camera_conditions.shape[1] == T_lat:\n                source = \"prepacked\"\n                if chunk_plucker is None and requires_chunk_plucker:\n                    raise ValueError(\n                        \"Prepacked latent-frame camera_conditions require \"\n                        \"chunk_plucker for this SANA-WM checkpoint. Pass \"\n                        \"chunk_plucker with shape (B,48,T,H,W), or pass \"\n                        \"original-frame camera_conditions so SGLang can \"\n                        \"derive chunk_plucker.\"\n                    )\n            else:\n                source = \"prebuilt_original_frames\"\n                original_camera_conditions = self._pad_or_trim_frames(\n                    camera_conditions, num_frames\n                )","sourceCodeStart":1870,"sourceCodeEnd":1906,"githubUrl":"https://github.com/sgl-project/sglang/blob/0132848349585cfe6aae51c4941cbae872505f8a/python/sglang/multimodal_gen/runtime/pipelines_core/stages/model_specific_stages/sana_wm/base.py#L1870-L1906","documentation":"Each camera condition frame must be a 20-element vector (intrinsics + pose packed layout). The last dimension of the (B,T,·) tensor must be exactly 20.","triggerScenarios":"Passing camera conditions packed as 16, 24, or 12 floats per frame, e.g. a 4x4 c2w matrix flattened to 16, or plücker rays in a different layout.","commonSituations":"Converting from another library's camera format (OpenCV rvec+tvec = 9 floats, c2w 4x4 = 16) without repacking into the 20-float layout SANA-WM expects.","solutions":["Repack each frame's camera params into the 20-float layout (typically intrinsics + pose encoding) expected by this checkpoint.","Check the model card / stage docs for the exact 20-dim composition.","If you have camera_to_world matrices, pass camera_to_world/camera_path instead and let the stage build conditions."],"exampleFix":"# before\ncamera_conditions = c2w.reshape(B, T, 16)\n# after\nresp = stage.forward(..., camera_to_world=c2w)  # let SGLang build (·,·,20)","handlingStrategy":"validation","validationCode":"assert camera_conditions.shape[-1] == 20, camera_conditions.shape","typeGuard":"def is_camera_condition_layout(t) -> bool:\n    return t.shape[-1] == 20","tryCatchPattern":null,"preventionTips":["Centralize the camera-packing helper so all paths emit the 20-float layout.","Prefer passing camera_to_world unless you specifically need packed conditions."],"tags":["sglang","sana-wm","camera-conditions","feature-dimension"],"backgroundTag":"tensor-shape-validation-failed","analyzedSha":"0132848349585cfe6aae51c4941cbae872505f8a","analyzedAt":"2026-08-28T05:10:05.995Z","schemaVersion":2},"datasetVersion":"2026-08-28T06:17:29.519Z"}