TokenDrive / README.md
Yunseong6's picture
Release the TokenDrive V3 Bench2Drive checkpoint
a82d6c2 verified
|
Raw History Blame Contribute Delete
3.97 kB
---
license: apache-2.0
base_model: OpenGVLab/InternViT-300M-448px
tags:
- autonomous-driving
- carla
- bench2drive
- pytorch
---
# TokenDrive V3
TokenDrive, described in *Real-Time Closed-Loop Driving with Structured Decision Tokens*, is a vision-based policy for closed-loop driving. It uses a front-facing camera image, a high-level driving command, and ego speed. It predicts structured speed context, route context, lateral action, and longitudinal action tokens. The policy returns 10 short-horizon speed waypoints and 64 long-horizon route waypoints, both in 2D. The Bench2Drive agent uses these predictions for vehicle control.
The policy uses an InternViT-300M-448px image encoder, projected patch features, an Action Conditioning Module (ACM) with FiLM modulation, and MLP waypoint heads. V3 training adds second-order smoothness penalties to the two waypoint sequences. The archived training configuration sets both smoothness weights to 0.1 and sets encoder freezing to false.
## Training data
This checkpoint was trained with the SimLingo-style CARLA driving dataset and TokenDrive's structured labels. The training configuration enables Town13 and the older towns. The dataset and its annotations are distributed separately and subject to their original terms. See the [TokenDrive code and setup instructions](https://github.com/jackkim777/TokenDrive).
## Checkpoint and evaluation provenance
This release contains the epoch-index 19 model from the `td_v3_smooth_seed42` run (training seed 42). The archived Bench2Drive agent logs identify this same checkpoint for Traffic Manager seeds 1, 2, and 3. Each run contains 220 route results.
| Evaluation seed | Driving Score | Success Rate |
|---|---:|---:|
| 1 | 88.05 | 67.73% |
| 2 | 88.44 | 67.73% |
| 3 | 88.79 | 68.64% |
| Mean ± population standard deviation | 88.43 ± 0.30 | 68.03 ± 0.43 percentage points |
These values come from the archived Bench2Drive results. All three rows evaluate the same training checkpoint. The archive contains its 400 FP16 model tensors, including the encoder. This release supports inference. Optimizer shards, trainer state, and training logs are excluded.
## Download and run
Clone [TokenDrive](https://github.com/jackkim777/TokenDrive) and set up the documented Conda environment, SimLingo training Python package, CARLA 0.9.15, and Bench2Drive. From the root of that checkout, download this model repository into `pretrained`. Replace `OWNER` with the namespace of this Model Card.
```bash
hf download OWNER/TokenDrive SHA256SUMS .hydra/config.yaml \
checkpoints/best.ckpt/latest \
checkpoints/best.ckpt/checkpoint/mp_rank_00_model_states.pt \
--local-dir pretrained
(cd pretrained && sha256sum -c SHA256SUMS)
```
`pretrained/.hydra/config.yaml` is required by the evaluation agent. Keep it two levels above the `best.ckpt` directory. The loader reads the model state from `best.ckpt/checkpoint/mp_rank_00_model_states.pt`. The encoder wrapper initializes from OpenGVLab's pretrained model and custom code before applying the checkpoint, so that dependency must be available from Hugging Face or in the local cache.
```bash
export TOKENDRIVE_REPO_ROOT="$PWD"
export CARLA_ROOT=/path/to/carla0915
export TOKENDRIVE_CHECKPOINT="$PWD/pretrained/checkpoints/best.ckpt"
export TOKENDRIVE_EVAL_OUTPUT="$PWD/eval_output"
python start_eval_tokendrive_v3.py
```
See the [evaluation guide](https://github.com/jackkim777/TokenDrive/blob/main/docs/USAGE.md#evaluation) for the benchmark layout and launcher requirements. CARLA, Bench2Drive, and their assets are separate dependencies.
## License
TokenDrive is released under Apache-2.0. The checkpoint includes a fine-tuned [InternViT-300M-448px](https://huggingface.co/OpenGVLab/InternViT-300M-448px) encoder, distributed by OpenGVLab under MIT. See [LICENSE](LICENSE) and [OpenGVLab's MIT notice](licenses/InternViT-MIT.txt). The SimLingo dataset, CARLA, and Bench2Drive retain their own terms.