run-leaderboard-evaluation
它能做什么
该技能在一组路线上为驾驶智能体运行 CARLA Leaderboard 评估。适合希望为智能体打分、并需要正确设置长时间测试运行的开发者。
适用场景
- ✓当你想在 Leaderboard 路线上评估你的驾驶智能体的时候。
- ✓当一次长时间评估崩溃,你想从检查点恢复它的时候。
- ✓当你想在完整运行之前对一条路线进行快速冒烟测试的时候。
技能链接
https://github.com/carla-simulator/carla/blob/ue58-dev/Skills/leaderboard/run-leaderboard-evaluation/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请先在 devtest 路线上运行我的智能体,然后启动完整的训练集,并设置一个可以恢复的检查点。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在开始之前检查整个设置,包括版本、地图、智能体类和传感器。它会先在一小组路线上运行冒烟测试,然后运行完整的路线集,并保存检查点。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Run a leaderboard evaluation
Paths.
scripts/…andreferences/…below are relative to the directory holding this SKILL.md. Your working directory is the user's project, not that directory, so prefix them with its absolute path or the command is not found.
leaderboard_evaluator.py drives your agent through each route, records
infractions, computes a driving score and writes a JSON checkpoint it can resume
from. It is a long-running batch job: routes_devtest.xml is 2 routes,
routes_validation.xml is 20, routes_training.xml is 90 routes in Town12 —
hours of wall clock, so the preflight matters more than usual.
Instructions
Progress:
- [ ] Step 1: Preflight everything (bash scripts/check_env.sh) — clear every FAIL
- [ ] Step 2: Smoke-test on one devtest route
- [ ] Step 3: Run the real set, with a checkpoint you can resume from
- [ ] Step 4: Read the results (read-leaderboard-results)
Step 1: Preflight
source scripts/env.sh
bash scripts/check_env.sh
This is the skill's main value. It checks, before anything expensive: the
leaderboard version, that scenario_runner is on the paired branch, that carla
/ agents / srunner / leaderboard all import, that the agent file exists and
defines the class the evaluator will look for, that the track is valid for the
version, and that Town12/Town13 exist on the running server.
Step 2-3: Run
source scripts/env.sh
# smoke test: one route, debug on
TEAM_AGENT="$LEADERBOARD_ROOT/leaderboard/autoagents/npc_agent.py" \
bash scripts/run_leaderboard.sh --routes-subset 0 --debug 1
# your agent over the validation set, resumable
TEAM_AGENT=~/team_code/my_agent.py TEAM_CONFIG=~/team_code/config.json \
CHECKPOINT_ENDPOINT=~/results/validation.json \
bash scripts/run_leaderboard.sh --routes "$LEADERBOARD_ROOT/data/routes_validation.xml"
# a slice of the training set, 3 repetitions each
bash scripts/run_leaderboard.sh --routes-subset '0-4,10' --repetitions 3
# resume after a crash — picks up where the checkpoint left off
bash scripts/run_leaderboard.sh --resume 1
The wrapper sets the environment, runs the preflight, then calls the evaluator.
The repo's own run_leaderboard.sh does the same thing with less checking — and
note it references DEBUG_CHECKPOINT_ENDPOINT without ever exporting it, so live
results silently go nowhere. This wrapper defaults it next to the checkpoint.
Everything the evaluator accepts, and what it means:
| Flag / env | Meaning |
|---|---|
--routes / ROUTES |
route XML (default data/routes_devtest.xml) |
--routes-subset / ROUTES_SUBSET |
'' = all, 0-4, 1,6,8, or 0-2,5,8-10 |
--repetitions / REPETITIONS |
repeats per route; each gets a fresh TM seed |
--track / CHALLENGE_TRACK_CODENAME |
SENSORS, MAP, SENSORS_QUALIFIER, MAP_QUALIFIER |
--agent / TEAM_AGENT |
the agent .py |
--agent-config / TEAM_CONFIG |
passed to your setup() |
--checkpoint / CHECKPOINT_ENDPOINT |
results JSON; also the resume state |
--debug-checkpoint / DEBUG_CHECKPOINT_ENDPOINT |
live text results, written when --debug >= 2 |
--debug / DEBUG_CHALLENGE |
0 quiet, 1 route/scenario info, 2+ live results |
--record / RECORD_PATH |
CARLA recorder output directory |
--resume / RESUME |
continue from the checkpoint instead of restarting |
--timeout |
per-route client timeout, default 300 s |
--traffic-manager-seed |
fixed per run; repetitions vary it deterministically |
--routes-subset is indices into the file, not route ids. They coincide in the
shipped files because ids are sequential from 0, but not in a hand-edited file.
What the evaluator forces
_setup_simulation applies these regardless of the server's current settings:
synchronous_mode = True, fixed_delta_seconds = 1/20
deterministic_ragdolls = True, spectator_as_ego = False
traffic_manager: synchronous, hybrid_physics_mode = True
per load_world: tile_stream_distance = 650, actor_active_distance = 650
world.reset_all_traffic_lights()
So do not bother setting weather, sync or TM options beforehand — they are overwritten. The 20 Hz tick rate is fixed and is what your agent's per-tick budget is measured against.
Step 4: Aftermath
The evaluator resets the world to async itself in _reset_world_settings, but
only if the run did not time out (`if self.world and self.manager and not
self._client_timed_out
常见问题
完整运行需要多长时间?
训练集在 Town12 中有 90 条路线,因此完整运行可能需要数小时,这也是要先做检查的原因。
运行在崩溃后可以恢复吗?
可以。评估器会写入检查点,运行可以从中恢复。
测试集有多大?
devtest 集有 2 条路线,验证集有 20 条,训练集有 90 条。
详情
作者的原始描述
Runs the CARLA Leaderboard evaluator over a set of routes with your agent — routes/routes-subset/repetitions/track selection, checkpoint and live-results endpoints, resume after a crash, recording, and the debug levels — for leaderboard 1.0, 2.0 or 2.1. Preflights the whole stack (version pairing, maps, ports, agent class, sensor budget) before spending hours, and hands the world back in async mode. Use when the user asks to "run the leaderboard", "evaluate my agent", "run routes_training", "resume an evaluation", or "reproduce my submission locally".
repo: carla-simulator/carla
热度
- GitHub 星标
- 15k
- 排名
- #11082
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
create-leaderboard-route
15k帮你的智能体通过在模拟器视角中放置路径点和场景触发器,构建 CARLA Leaderboard 路线文件,并对其进行检查和排序。
package-leaderboard-agent
15k帮你的智能体把驾驶智能体打包成 Docker 镜像,用于提交 CARLA Leaderboard,并检查文件夹结构,测试镜像能否加载它。
read-leaderboard-results
15k帮你的智能体阅读 CARLA Leaderboard 结果文件,解释每条路线的得分和违规情况,并按另一规则版本重新计分。
write-leaderboard-agent
15k帮你的智能体为 CARLA Leaderboard 编写驾驶智能体,使用正确的类、符合赛道限制的传感器配置,以及一个可运行的起始文件。