I tried to use async inference,
I run this in server: python -m lerobot.scripts.server.policy_server --host="xx,xx,xx,xx" --port=9000
And have models in server.
run this locally:
PYTHONPATH=src python src/lerobot/scripts/server/robot_client.py --config_path=async_evaluate/template.yaml
the yaml looks like:
server_address: xx.xx.xx.xx:9000
robot:
type: so100_follower
port: /dev/ttyACM0
id: congbi
cameras:
side:
type: intelrealsense
serial_number_or_name: aaaaaaaaaaa
width: 640
height: 480
fps: 30
use_depth: false
wrist:
type: opencv
index_or_path: 6
width: 640
height: 480
fps: 30
task: "pick up the cube and place it into the box."
policy_type: smolvla
pretrained_name_or_path: outputs/train/bbb/checkpoints/last/pretrained_model
policy_device: cuda
actions_per_chunk: 50
chunk_size_threshold: 0.5
aggregate_fn_name: weighted_average
debug_visualize_queue_size: true
# dataset:
# repo_id: eval/eval_firts50_baseline
# num_episodes: 1
# episode_time_s: 60
# push_to_hub: false
# reset_time_s: 0
Then I saw these in server(they look similar)
INFO 2025-07-13 12:59:54 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 2.17ms
INFO 2025-07-13 12:59:54 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:54 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:54 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 1.89ms
INFO 2025-07-13 12:59:54 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:54 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:54 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 1.80ms
INFO 2025-07-13 12:59:54 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:54 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:54 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 2.52ms
INFO 2025-07-13 12:59:54 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:54 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:55 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 2.25ms
INFO 2025-07-13 12:59:55 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:55 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:55 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 2.10ms
INFO 2025-07-13 12:59:55 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:55 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:55 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 1.77ms
INFO 2025-07-13 12:59:55 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:55 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:55 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 1.81ms
INFO 2025-07-13 12:59:55 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:55 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:55 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 1.92ms
INFO 2025-07-13 12:59:55 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:55 /helpers.py:354 Starting receiver
INFO 2025-07-13 12:59:55 y_server.py:175 Received observation #0 | Avg FPS: 5.95 | Target: 30.00 | One-way latency: 1.84ms
INFO 2025-07-13 12:59:55 y_server.py:191 Observation #0 has been filtered out
INFO 2025-07-13 12:59:55 /helpers.py:354 Starting receiver
By the way I saw reduce layer to 16 so the server got policy message and load policy correcly.
And to test I add an Error om getAction function
# Create and return the action chunk
actions = async_inference_pb2.Actions(data=actions_bytes)
raise KeyError("generate an action")
self.logger.info(
f"Action chunk #{obs.get_timestep()} generated | "
f"Total time: {(inference_time + serialize_time) * 1000:.2f}ms"
)
But nothing happened. So I think getAction wasn't used at all.
And locally terminal said:
INFO 2025-07-13 20:59:54 t_client.py:471 Control loop (ms): 166.87
INFO 2025-07-13 20:59:55 t_client.py:213 Sent observation #0 |
INFO 2025-07-13 20:59:55 t_client.py:471 Control loop (ms): 168.18
INFO 2025-07-13 20:59:55 t_client.py:213 Sent observation #0 |
INFO 2025-07-13 20:59:55 t_client.py:471 Control loop (ms): 169.37
INFO 2025-07-13 20:59:55 t_client.py:213 Sent observation #0 |
INFO 2025-07-13 20:59:55 t_client.py:471 Control loop (ms): 165.41
INFO 2025-07-13 20:59:55 t_client.py:213 Sent observation #0 |
INFO 2025-07-13 20:59:55 t_client.py:471 Control loop (ms): 165.57
INFO 2025-07-13 20:59:55 t_client.py:213 Sent observation #0 |
INFO 2025-07-13 20:59:55 t_client.py:471 Control loop (ms): 166.10
(My server time is incorrect, I run them at the same time.)
And of course no action made by my robot.;-;
How to solve it?
lerobot: d2645cb
I tried to use async inference,
I run this in server:
python -m lerobot.scripts.server.policy_server --host="xx,xx,xx,xx" --port=9000And have models in server.
run this locally:
PYTHONPATH=src python src/lerobot/scripts/server/robot_client.py --config_path=async_evaluate/template.yamlthe yaml looks like:
Then I saw these in server(they look similar)
By the way I saw
reduce layer to 16so the server got policy message and load policy correcly.And to test I add an Error om
getActionfunctionBut nothing happened. So I think getAction wasn't used at all.
And locally terminal said:
(My server time is incorrect, I run them at the same time.)
And of course no action made by my robot.;-;
How to solve it?
lerobot: d2645cb