Skip to content

[Bug] zeroshot infer error #120

Open

Description

@zkailinzhang

这是日志
2026-09-08 21:14:58,492 - wall_x._vendor.harrix.serving.scheduler - INFO - Batch processed in 89.4ms, throughput: 11.2 req/s
2026-09-08 21:14:58,496 - wall_x._vendor.harrix.serving.websocket_policy_server - INFO - Connection from ('192.168.5.6', 57346) closed
2026-09-08 21:14:59,572 - websockets.server - INFO - connection open
2026-09-08 21:14:59,572 - wall_x._vendor.harrix.serving.websocket_policy_server - INFO - Connection from ('192.168.5.6', 57354) opened
2026-09-08 21:14:59,620 - wall_x._vendor.harrix.serving.scheduler - INFO - Processing batch of 1 requests
2026-09-08 21:14:59,621 - wall_x._vendor.harrix.serving.policy.wall_x_policy - INFO - WallXPolicy.infer_batch: processing 1 observations
[21:14:59] [ ROBOT ] [ROBOT.Robot] INFO EX001RobotPreprocessor: using 'camera_front' as 'face_view'
[21:14:59] [ ROBOT ] [ROBOT.Robot] INFO EX001RobotPreprocessor: using 'camera_left' as 'left_wrist_view'
[21:14:59] [ ROBOT ] [ROBOT.Robot] INFO EX001RobotPreprocessor: using 'camera_right' as 'right_wrist_view'
2026-09-08 21:14:59,657 - wall_x.utils.timers - INFO - get_text_for_action took 0.010 ms to execute
2026-09-08 21:14:59,659 - wall_x.utils.timers - INFO - resize_images took 2.147 ms to execute
2026-09-08 21:14:59,661 - wall_x.utils.timers - INFO - preprocesser_call took 2.385 ms to execute
2026-09-08 21:14:59,662 - wall_x.utils.timers - INFO - convert_action_token_id and post took 0.188 ms to execute
2026-09-08 21:14:59,662 - wall_x.utils.timers - INFO - construct_model_input took 5.187 ms to execute
2026-09-08 21:14:59,707 - wall_x.utils.timers - INFO - generate_flow_action_batch took 45.366 ms to execute
2026-09-08 21:14:59,707 - wall_x._vendor.harrix.serving.policy.wall_x_policy - ERROR - Batch inference failed: shape mismatch: value tensor of shape [32, 2048] cannot be broadcast to indexing result of shape [0, 2048]
Traceback (most recent call last):
File "/home/user/wall-x/wall_x/_vendor/harrix/serving/policy/wall_x_policy.py", line 296, in infer_batch
model_outputs = self.model_wrapper.infer_flow_action_batch(
File "/home/user/wall-x/wall_x/_vendor/harrix/serving/_wallx_infer/model_wrapper.py", line 639, in infer_flow_action_batch
model_output = self.model.generate_flow_action(
File "/home/user/anaconda3/envs/wallx/lib/python3.10/site-packages/torch/utils/_contextlib.py", line 124, in decorate_context
return func(*args, **kwargs)
File "/home/user/wall-x/wall_x/model/qact/qwen2_5/modeling_qwen2_5_vl_act.py", line 1806, in generate_flow_action
ctx = self._prepare_flow_action_inputs(
File "/home/user/wall-x/wall_x/model/qact/qwen2_5/modeling_qwen2_5_vl_act.py", line 2078, in _prepare_flow_action_inputs
inputs_embeds[flow_action_mask] = action_embed
RuntimeError: shape mismatch: value tensor of shape [32, 2048] cannot be broadcast to indexing result of shape [0, 2048]

Activity

  1. zkailinzhang commented on Sep 8, 2026

    @zkailinzhang
    Author

    部署和推理代码

    nohup bash scripts/run_serving.sh --checkpoint-path /home/user/models/wall-oss-0.5 --port 32195 --serialize-actions --max-batch-size 2 --robot-type ex001 --debug > wallx_serve_09082.log 2>&1 &
    
    import asyncio
    import base64
    import json
    import msgpack
    import websockets
    
    WS_URI = "ws://192.168.5.80:32195"
    INSTRUCTION = "pick the cup"
    
    dummy_state = {
        "follow1_pos": [0.0] * 7,
        "follow2_pos": [0.0] * 7,
    }
    
    def img_to_b64(img_path):
        with open(img_path, "rb") as f:
            return base64.b64encode(f.read()).decode("utf-8")
    
    dummy_views = {
        "camera_front": img_to_b64("/home/zkl/lerobot/sdk_robot/examples/HeadRGBStream_screenshot_08.09.2026.png"),
        "camera_left": img_to_b64("/home/zkl/lerobot/sdk_robot/examples/LeftArmStream_screenshot_08.09.2026.png"),
        "camera_right": img_to_b64("/home/zkl/lerobot/sdk_robot/examples/RightArmStream_screenshot_08.09.2026.png"),
    }
    
    payload = {
        "state": dummy_state,
        "views": dummy_views,
        "instruction": INSTRUCTION,
    }
    
    async def main():
        async with websockets.connect(WS_URI) as ws:
            meta_raw = await ws.recv()
            meta = msgpack.unpackb(meta_raw, raw=False)
            print("收到 metadata:", json.dumps(meta, indent=2, ensure_ascii=False))
    
            await ws.send(msgpack.packb(payload, use_bin_type=True))
    
            resp_raw = await ws.recv()
            if isinstance(resp_raw, str):
                print("服务端文本错误:")
                print(resp_raw)
                return
    
            resp = msgpack.unpackb(resp_raw, raw=False)
            print("模型输出 action:")
            print(json.dumps(resp, indent=2, ensure_ascii=False))
    
            print("左臂:", resp.get("follow1_pos"))
            print("右臂:", resp.get("follow2_pos"))
    
    if __name__ == "__main__":
        asyncio.run(main())
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions