Giter Site home page Giter Site logo

autonomousvision / transfuser Goto Github PK

View Code? Open in Web Editor NEW
987.0 24.0 170.0 43.37 MB

[PAMI'23] TransFuser: Imitation with Transformer-Based Sensor Fusion for Autonomous Driving; [CVPR'21] Multi-Modal Fusion Transformer for End-to-End Autonomous Driving

License: MIT License

Python 91.44% Ruby 0.06% HTML 1.23% SCSS 0.01% JavaScript 0.07% Shell 0.62% Dockerfile 0.13% CSS 0.12% XSLT 6.32%
imitation-learning autonomous-driving transformers sensor-fusion

transfuser's Introduction

TransFuser: Imitation with Transformer-Based Sensor Fusion for Autonomous Driving

PWC

This repository contains the code for the PAMI 2023 paper TransFuser: Imitation with Transformer-Based Sensor Fusion for Autonomous Driving. This work is a journal extension of the CVPR 2021 paper Multi-Modal Fusion Transformer for End-to-End Autonomous Driving. The code for the CVPR 2021 paper is available in the cvpr2021 branch.

If you find our code or papers useful, please cite:

@article{Chitta2023PAMI,
  author = {Chitta, Kashyap and
            Prakash, Aditya and
            Jaeger, Bernhard and
            Yu, Zehao and
            Renz, Katrin and
            Geiger, Andreas},
  title = {TransFuser: Imitation with Transformer-Based Sensor Fusion for Autonomous Driving},
  journal = {Pattern Analysis and Machine Intelligence (PAMI)},
  year = {2023},
}
@inproceedings{Prakash2021CVPR,
  author = {Prakash, Aditya and
            Chitta, Kashyap and
            Geiger, Andreas},
  title = {Multi-Modal Fusion Transformer for End-to-End Autonomous Driving},
  booktitle = {Conference on Computer Vision and Pattern Recognition (CVPR)},
  year = {2021}
}

Also, check out the code for other recent work on CARLA from our group:

Contents

  1. Setup
  2. Dataset and Training
  3. Evaluation

Setup

Clone the repo, setup CARLA 0.9.10.1, and build the conda environment:

git clone https://github.com/autonomousvision/transfuser.git
cd transfuser
git checkout 2022
chmod +x setup_carla.sh
./setup_carla.sh
conda env create -f environment.yml
conda activate tfuse
pip install torch-scatter -f https://data.pyg.org/whl/torch-1.11.0+cu102.html
pip install mmcv-full==1.5.3 -f https://download.openmmlab.com/mmcv/dist/cu102/torch1.11.0/index.html

Dataset and Training

Our dataset is generated via a privileged agent which we call the autopilot (/team_code_autopilot/autopilot.py) in 8 CARLA towns using the routes and scenario files provided in this folder. See the tools/dataset folder for detailed documentation regarding the training routes and scenarios. You can download the dataset (210GB) by running:

chmod +x download_data.sh
./download_data.sh

The dataset is structured as follows:

- Scenario
    - Town
        - Route
            - rgb: camera images
            - depth: corresponding depth images
            - semantics: corresponding segmentation images
            - lidar: 3d point cloud in .npy format
            - topdown: topdown segmentation maps
            - label_raw: 3d bounding boxes for vehicles
            - measurements: contains ego-agent's position, velocity and other metadata

Data generation

In addition to the dataset itself, we have provided the scripts for data generation with our autopilot agent. To generate data, the first step is to launch a CARLA server:

./CarlaUE4.sh --world-port=2000 -opengl

For more information on running CARLA servers (e.g. on a machine without a display), see the official documentation. Once the server is running, use the script below for generating training data:

./leaderboard/scripts/datagen.sh <carla root> <working directory of this repo (*/transfuser/)>

The main variables to set for this script are SCENARIOS and ROUTES.

Training script

The code for training via imitation learning is provided in train.py.
A minimal example of running the training script on a single machine:

cd team_code_transfuser
python train.py --batch_size 10 --logdir /path/to/logdir --root_dir /path/to/dataset_root/ --parallel_training 0

The training script has many more useful features documented at the start of the main function. One of them is parallel training. The script has to be started differently when training on a multi-gpu node:

cd team_code_transfuser
CUDA_VISIBLE_DEVICES=0,1 OMP_NUM_THREADS=16 OPENBLAS_NUM_THREADS=1 torchrun --nnodes=1 --nproc_per_node=2 --max_restarts=0 --rdzv_id=1234576890 --rdzv_backend=c10d train.py --logdir /path/to/logdir --root_dir /path/to/dataset_root/ --parallel_training 1

Enumerate the GPUs you want to train on with CUDA_VISIBLE_DEVICES. Set the variable OMP_NUM_THREADS to the number of cpus available on your system. Set OPENBLAS_NUM_THREADS=1 if you want to avoid threads spawning other threads. Set --nproc_per_node to the number of available GPUs on your node.

The evaluation agent file is build to evaluate models trained with multiple GPUs. If you want to evaluate a model trained with a single GPU you need to remove this line.

Evaluation

Longest6 benchmark

We make some minor modifications to the CARLA leaderboard code for the Longest6 benchmark, which are documented here. See the leaderboard/data/longest6 folder for a description of Longest6 and how to evaluate on it.

Pretrained agents

Pre-trained agent files for all 4 methods can be downloaded from AWS:

mkdir model_ckpt
wget https://s3.eu-central-1.amazonaws.com/avg-projects/transfuser/models_2022.zip -P model_ckpt
unzip model_ckpt/models_2022.zip -d model_ckpt/
rm model_ckpt/models_2022.zip

Running an agent

To evaluate a model, we first launch a CARLA server:

./CarlaUE4.sh --world-port=2000 -opengl

Once the CARLA server is running, evaluate an agent with the script:

./leaderboard/scripts/local_evaluation.sh <carla root> <working directory of this repo (*/transfuser/)>

By editing the arguments in local_evaluation.sh, we can benchmark performance on the Longest6 routes. You can evaluate both privileged agents (such as [autopilot.py]) and sensor-based models. To evaluate the sensor-based models use submission_agent.py as the TEAM_AGENT and point to the folder you downloaded the model weights into for the TEAM_CONFIG. The code is automatically configured to use the correct method based on the args.txt file in the model folder.

You can look at qualitative examples of the expected driving behavior of TransFuser on the Longest6 routes here.

Parsing longest6 results

To compute additional statistics from the results of evaluation runs we provide a parser script tools/result_parser.py.

${WORK_DIR}/tools/result_parser.py --xml ${WORK_DIR}/leaderboard/data/longest6/longest6.xml --results /path/to/folder/with/json_results/ --save_dir /path/to/output --town_maps ${WORK_DIR}/leaderboard/data/town_maps_xodr

It will generate a results.csv file containing the average results of the run as well as additional statistics. It also generates town maps and marks the locations where infractions occurred.

Submitting to the CARLA leaderboard

To submit to the CARLA leaderboard you need docker installed on your system. Edit the paths at the start of make_docker.sh. Create the folder team_code_transfuser/model_ckpt/transfuser. Copy the model.pth files and args.txt that you want to evaluate to team_code_transfuser/model_ckpt/transfuser. If you want to evaluate an ensemble simply copy multiple .pth files into the folder, the code will load all of them and ensemble the predictions.

cd leaderboard
cd scripts
./make_docker.sh

The script will create a docker image with the name transfuser-agent. Follow the instructions on the leaderboard to make an account and install alpha.

alpha login
alpha benchmark:submit  --split 3 transfuser-agent:latest

The command will upload the docker image to the cloud and evaluate it.

transfuser's People

Contributors

ap229997 avatar jonaskrug avatar kait0 avatar kashyap7x avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

transfuser's Issues

About Scenarios in training data

Hi, you mentioned that you include 7 different Scenarios when trainning, according to my undertanding, the event are triggered by "other_actors" in the scenario files, but it seems that your scenario files for each town does not contain other_actors. Is my understanding correct and could you please clarify this? Thank you in advance!

Hi, when I started the training progress, I met an error about cuda. Could you please tell me which version of cuda do you use?

I use a single GPU RTX3080, and cuda10.1, cudnn7.6.3, and torch1.4.0 as you specify in requirements.txt.
When I ran train.py to train the transfuser model, an error occurred: RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED.
After searching this error, I set torch.backends.cudnn.enabled=false, but another error came: RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc). I guess it is the problem of version.

Data Description

I am wondering whether we have a data description? Or can you describe what are command, x_command, y_command and theta in data.py?

Also, can you please provide the code that can regenerate the preload files? Because the preload files in the dataset folder used old pathes.

Question about result table on paper

It's really a great job and clear codes as I said in the mail too. Thanks for your work!

But when I shared the paper with my labmates, who question about the result table on paper here:
image

  1. As you can see here, we can know that tranfuser and other models may have variance but the number is too big, so did you try to explain the driving score belief.

  2. As I know that, your expert is from

    The expert agent is based on the autopilot from this codebase.

    But the expert as we all know is rule-based, when our traffic random seed is always default in leaderboard_evaluator.py as 0, so all simulator's NPCs have same action as carla said here when you run Town05 Short or Long, why the expert will have 6.21 variance and 4.00 variance score?

Thanks again!

About the input sequence and PID controller

Hi @ap229997 , I really like your amazing works. It inspires me a lot. However, there are 2 things that I want to know.

  1. In your paper, it is said that the transfuser takes a sequence of inputs. However, it is not described exactly how many inputs the model takes (neither in the supplementary file). In the config.py on each model, I see that you set the parameter
    seq_len = 1 # input timesteps
    Does it mean that each model just takes 1 input and not a sequence of inputs (that contains several inputs)? Could you please explain to me how you feed the inputs to your model?

  2. In your paper, it is said that each model (except CILRS) is predicting 4 waypoints (in BEV x,y coordinate). Then, I check the PID controller on the supplementary file and the codes (model.py,

    def control_pid(self, waypoints, velocity):
    ), it seems that only 2 waypoints (the first and second one) are considered to control the steer and throttle. So, what is the purpose of predicting 2 extra waypoints? Is it used to give the GRU more learning experience during the training process?

Thanks in advance.

Is the calculation of the route length wrong? I feel unreasonable.

Hello, I have some problems and need to ask you for advice. During the test, I carefully analyzed the result.json file I got, and I found that the length of all the routes were almost the same, but I observed the distance the agent was driving on each route, and I could clearly feel that the distances were not exactly the same. of. The test route I ran was Town05-short, and I checked the sample_result.json file you gave and found that the length of the route calculated in it is also the same, which I don’t think is reasonable. Later, I also analyzed the corresponding code for calculating the length of the route, and found that only the Euclidean distance of the two waypoints in Town05-short was calculated, which was unreasonable. In addition, I feel that the unit of distance is not very reasonable.

routeid(in Town05_short.xml)



















the corresponding code for calculating the length of the route

def compute_route_length(config):
trajectory = config.trajectory
print('trajectory:', trajectory)

route_length = 0.0
previous_location = None
for location in trajectory:
    print('location:', location)
    if previous_location:
        dist = math.sqrt((location.x-previous_location.x)*(location.x-previous_location.x) +
                         (location.y-previous_location.y)*(location.y-previous_location.y) +
                         (location.z - previous_location.z) * (location.z - previous_location.z))
        route_length += dist
    previous_location = location

return route_length

The printed output is as follows

trajectory: [<carla.libcarla.Location object at 0x7fae161d2cb0>, <carla.libcarla.Location object at 0x7fae161d2cf0>]
location: Location(x=72.750000, y=-215.149994, z=0.000000)
location: Location(x=22.750000, y=-265.149994, z=0.000000)

trajectory: [<carla.libcarla.Location object at 0x7fae161d2e30>, <carla.libcarla.Location object at 0x7fae161d2e70>]
location: Location(x=-163.149994, y=-78.949997, z=0.000000)
location: Location(x=-113.149994, y=-28.949997, z=0.000000)

trajectory: [<carla.libcarla.Location object at 0x7fae161d2fb0>, <carla.libcarla.Location object at 0x7fae161d4030>]
location: Location(x=-163.149994, y=11.599999, z=0.000000)
location: Location(x=-113.149994, y=61.599998, z=0.000000)

trajectory: [<carla.libcarla.Location object at 0x7fae161d4170>, <carla.libcarla.Location object at 0x7fae161d41b0>]
location: Location(x=-229.349991, y=12.450000, z=0.000000)
location: Location(x=-179.349991, y=62.450001, z=0.000000)

trajectory: [<carla.libcarla.Location object at 0x7fae161d42f0>, <carla.libcarla.Location object at 0x7fae161d4330>]
location: Location(x=-9.150002, y=216.349991, z=0.000000)
location: Location(x=40.849998, y=266.350006, z=0.000000)

The above is my analysis process。

Please help to check if there is a problem with unit conversion in this place.This variable route_length_kms
for key in global_record.infractions.keys():
route_length_kms = max(route_record.scores['score_route'] * route_record.meta['route_length'] / 1000.0, 0.001)
# print('route_length_kms:', route_length_kms)
if isinstance(global_record.infractions[key], list):
global_record.infractions[key] = len(route_record.infractions[key]) / route_length_kms
# print('global_record1'+key, global_record.infractions[key])
else:
global_record.infractions[key] += len(route_record.infractions[key]) / route_length_kms
# print('global_record2' + key, global_record.infractions[key])

The following is the result of my actual test of the entire 32 routes, and I can find that the length of the routes is almost the same.

{
"_checkpoint": {
"global_record": {
"index": -1,
"infractions": {
"collisions_layout": 2.8715065885454454,
"collisions_pedestrian": 0.0,
"collisions_vehicle": 1.0227292963792376,
"outside_route_lanes": 3.6858155387424802,
"red_light": 0.8050101972767116,
"route_dev": 0.0,
"route_timeout": 3.2362850377922685,
"stop_infraction": 0.28284271247461895,
"vehicle_blocked": 0.3156225165413895
},
"meta": {
"exceptions": [
[
"RouteScenario_1",
1,
"Failed - Agent timed out"
],
[
"RouteScenario_3",
3,
"Failed - Agent timed out"
],
[
"RouteScenario_11",
11,
"Failed - Agent timed out"
],
[
"RouteScenario_12",
12,
"Failed - Agent timed out"
],
[
"RouteScenario_15",
15,
"Failed - Agent timed out"
],
[
"RouteScenario_17",
17,
"Failed - Agent timed out"
],
[
"RouteScenario_18",
18,
"Failed - Agent timed out"
],
[
"RouteScenario_19",
19,
"Failed - Agent got blocked"
],
[
"RouteScenario_21",
21,
"Failed - Agent timed out"
],
[
"RouteScenario_30",
30,
"Failed - Agent got blocked"
]
]
},
"route_id": -1,
"scores": {
"score_composed": 59.377711080823985,
"score_penalty": 0.7169920628092165,
"score_route": 85.88632460228627
},
"status": "Failed"
},
"progress": [
32,
32
],
"records": [
{
"index": 0,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=24.565, y=-124.058, z=0.093)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 1.0 meters (0.74% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 55.60000082850456,
"duration_system": 229.1740369796753,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_0",
"scores": {
"score_composed": 64.5181521493852,
"score_penalty": 0.645181521493852,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 1,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 82.10000122338533,
"duration_system": 315.976313829422,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_1",
"scores": {
"score_composed": 15.816533902953283,
"score_penalty": 1.0,
"score_route": 15.816533902953283
},
"status": "Failed - Agent timed out"
},
{
"index": 2,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 135.50000201910734,
"duration_system": 537.7416558265686,
"route_length": 70.71068081605311
},
"route_id": "RouteScenario_2",
"scores": {
"score_composed": 100.0,
"score_penalty": 1.0,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 3,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 84.10000125318766,
"duration_system": 338.4886083602905,
"route_length": 70.71067542125691
},
"route_id": "RouteScenario_3",
"scores": {
"score_composed": 45.504720599849136,
"score_penalty": 1.0,
"score_route": 45.504720599849136
},
"status": "Failed - Agent timed out"
},
{
"index": 4,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 9.400000140070915,
"duration_system": 36.520349740982056,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_4",
"scores": {
"score_composed": 100.0,
"score_penalty": 1.0,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 5,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=-96.11, y=-148.139, z=0.144)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 54.30000080913305,
"duration_system": 209.91269731521606,
"route_length": 70.71067272385835
},
"route_id": "RouteScenario_5",
"scores": {
"score_composed": 65.0,
"score_penalty": 0.65,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 6,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=21.891, y=-24.725, z=0.106)",
"Agent collided against object with type=static.vegetation and id=0 at (x=-41.497, y=-73.352, z=0.182)",
"Agent collided against object with type=static.fence and id=0 at (x=-96.643, y=-148.105, z=0.145)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 7.553 meters (2.24% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 188.30000280588865,
"duration_system": 713.6245098114014,
"route_length": 70.71067272385835
},
"route_id": "RouteScenario_6",
"scores": {
"score_composed": 26.848361753139287,
"score_penalty": 0.2684836175313929,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 7,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=21.728, y=-24.807, z=0.098)",
"Agent collided against object with type=static.vegetation and id=0 at (x=-41.953, y=-70.59, z=0.126)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 3.019 meters (1.35% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 141.00000210106373,
"duration_system": 534.5629999637604,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_7",
"scores": {
"score_composed": 41.67981150619306,
"score_penalty": 0.41679811506193065,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 8,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=22.144, y=-25.445, z=0.103)",
"Agent collided against object with type=static.vegetation and id=0 at (x=-41.951, y=-71.962, z=0.125)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 2.009 meters (0.59% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 213.80000318586826,
"duration_system": 810.2113950252533,
"route_length": 70.71067272385835
},
"route_id": "RouteScenario_8",
"scores": {
"score_composed": 41.99945519646888,
"score_penalty": 0.4199945519646888,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 9,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.wall and id=0 at (x=-58.828, y=-24.497, z=0.198)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [
"Agent collided against object with type=vehicle.tesla.model3 and id=2471 at (x=-57.293, y=-19.831, z=0.201)"
],
"outside_route_lanes": [
"Agent went outside its route lanes for about 17.978 meters (5.69% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 258.50000385195017,
"duration_system": 1026.7993097305298,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_9",
"scores": {
"score_composed": 36.78218670588869,
"score_penalty": 0.3678218670588869,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 10,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 11.006 meters (3.48% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 200.20000298321247,
"duration_system": 787.2652983665466,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_10",
"scores": {
"score_composed": 96.51864630799476,
"score_penalty": 0.9651864630799476,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 11,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 8.0 meters (11.34% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 232.1000034585595,
"duration_system": 890.8772931098938,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_11",
"scores": {
"score_composed": 21.975608873219713,
"score_penalty": 0.8866090267556594,
"score_route": 24.786132568077235
},
"status": "Failed - Agent timed out"
},
{
"index": 12,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 7.0 meters (10.06% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 232.1000034585595,
"duration_system": 887.9825072288513,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_12",
"scores": {
"score_composed": 21.975609543300838,
"score_penalty": 0.8993564189036121,
"score_route": 24.43481703292992
},
"status": "Failed - Agent timed out"
},
{
"index": 13,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [
"Agent collided against object with type=vehicle.tesla.model3 and id=3405 at (x=-160.644, y=5.684, z=0.033)"
],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 28.200000420212746,
"duration_system": 115.39388585090637,
"route_length": 70.71067879300433
},
"route_id": "RouteScenario_13",
"scores": {
"score_composed": 60.0,
"score_penalty": 0.6,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 14,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 15.087 meters (5.07% of the completed route)"
],
"red_light": [
"Agent ran a red light 3576 at (x=-139.8, y=77.85, z=0.0)"
],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 132.8000019788742,
"duration_system": 521.3502044677734,
"route_length": 70.71067744430518
},
"route_id": "RouteScenario_14",
"scores": {
"score_composed": 66.4543919704123,
"score_penalty": 0.664543919704123,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 15,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 5.0 meters (2.94% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 245.1000036522746,
"duration_system": 948.3015851974487,
"route_length": 70.71067744430518
},
"route_id": "RouteScenario_15",
"scores": {
"score_composed": 54.89453188665499,
"score_penalty": 0.970574924380384,
"score_route": 56.55877821251122
},
"status": "Failed - Agent timed out"
},
{
"index": 16,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 2.0 meters (1.01% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 107.60000160336494,
"duration_system": 415.7183201313019,
"route_length": 70.71067744430518
},
"route_id": "RouteScenario_16",
"scores": {
"score_composed": 98.99458408795041,
"score_penalty": 0.9899458408795042,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 17,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 248.1000036969781,
"duration_system": 972.11772108078,
"route_length": 70.71067879300433
},
"route_id": "RouteScenario_17",
"scores": {
"score_composed": 67.45627731531455,
"score_penalty": 1.0,
"score_route": 67.45627731531455
},
"status": "Failed - Agent timed out"
},
{
"index": 18,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 7.0 meters (3.39% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 248.1000036969781,
"duration_system": 978.5529363155365,
"route_length": 70.71067879300433
},
"route_id": "RouteScenario_18",
"scores": {
"score_composed": 65.48667782332225,
"score_penalty": 0.966100446604399,
"score_route": 67.78454357773202
},
"status": "Failed - Agent timed out"
},
{
"index": 19,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=-89.723, y=156.914, z=0.162)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [
"Agent collided against object with type=vehicle.chevrolet.impala and id=4826 at (x=30.472, y=66.293, z=0.034)"
],
"outside_route_lanes": [
"Agent went outside its route lanes for about 6.946 meters (1.64% of the completed route)"
],
"red_light": [
"Agent ran a red light 4809 at (x=40.25, y=-11.1, z=0.0)"
],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": [
"Agent got blocked at (x=-90.048, y=157.088, z=0.162)"
]
},
"meta": {
"duration_game": 325.50000485032797,
"duration_system": 1251.3523309230804,
"route_length": 70.71067272385835
},
"route_id": "RouteScenario_19",
"scores": {
"score_composed": 22.73413419766088,
"score_penalty": 0.26852969603891597,
"score_route": 84.66152732085986
},
"status": "Failed - Agent got blocked"
},
{
"index": 20,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 41.50000061839819,
"duration_system": 156.86240601539612,
"route_length": 70.71066732906154
},
"route_id": "RouteScenario_20",
"scores": {
"score_composed": 100.0,
"score_penalty": 1.0,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 21,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=-211.543, y=9.44, z=0.116)",
"Agent collided against object with type=static.vegetation and id=0 at (x=-152.822, y=80.251, z=0.148)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 4.0 meters (2.1% of the completed route)"
],
"red_light": [
"Agent ran a red light 5276 at (x=-138.8, y=100.05, z=0.0)"
],
"route_dev": [],
"route_timeout": [
"Route timeout."
],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 235.100003503263,
"duration_system": 953.9440562725067,
"route_length": 70.71067879300433
},
"route_id": "RouteScenario_21",
"scores": {
"score_composed": 19.161593966606734,
"score_penalty": 0.2895522928174864,
"score_route": 66.17662661260593
},
"status": "Failed - Agent timed out"
},
{
"index": 22,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [
"Agent collided against object with type=vehicle.tesla.model3 and id=5626 at (x=-145.848, y=-87.496, z=0.033)",
"Agent collided against object with type=vehicle.audi.a2 and id=5574 at (x=25.94, y=-200.206, z=0.034)"
],
"outside_route_lanes": [
"Agent went outside its route lanes for about 9.899 meters (0.82% of the completed route)"
],
"red_light": [
"Agent ran a red light 5495 at (x=-39.6, y=-78.1, z=0.0)"
],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [
"Agent ran a stop with id=5446 at (x=-191.645, y=-105.688, z=0.055)"
],
"vehicle_blocked": []
},
"meta": {
"duration_game": 370.4000055193901,
"duration_system": 1439.731341123581,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_22",
"scores": {
"score_composed": 19.995060452993396,
"score_penalty": 0.19995060452993396,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 23,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 368.20000548660755,
"duration_system": 1385.1476845741272,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_23",
"scores": {
"score_composed": 100.0,
"score_penalty": 1.0,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 24,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 19.000000283122063,
"duration_system": 82.74256825447083,
"route_length": 70.71067272385835
},
"route_id": "RouteScenario_24",
"scores": {
"score_composed": 100.0,
"score_penalty": 1.0,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 25,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 8.444 meters (2.37% of the completed route)"
],
"red_light": [
"Agent ran a red light 6255 at (x=-112.3, y=159.4, z=0.0)"
],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [
"Agent ran a stop with id=6178 at (x=-174.012, y=87.973, z=0.0)"
],
"vehicle_blocked": []
},
"meta": {
"duration_game": 99.00000147521496,
"duration_system": 408.0858151912689,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_25",
"scores": {
"score_composed": 54.67482776636333,
"score_penalty": 0.5467482776636333,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 26,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.fence and id=0 at (x=-42.152, y=108.564, z=0.121)",
"Agent collided against object with type=static.static and id=0 at (x=-40.565, y=19.822, z=0.156)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [
"Agent collided against object with type=vehicle.seat.leon and id=6616 at (x=36.179, y=-171.243, z=0.033)"
],
"outside_route_lanes": [
"Agent went outside its route lanes for about 2.021 meters (0.16% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 347.5000051781535,
"duration_system": 1298.6998102664948,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_26",
"scores": {
"score_composed": 25.30994584247554,
"score_penalty": 0.2530994584247554,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 27,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [
"Agent went outside its route lanes for about 1.0 meters (0.07% of the completed route)"
],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 381.0000056773424,
"duration_system": 1437.4280700683594,
"route_length": 70.71067272385835
},
"route_id": "RouteScenario_27",
"scores": {
"score_composed": 99.92689670018206,
"score_penalty": 0.9992689670018206,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 28,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.guardrail and id=0 at (x=2.22, y=201.634, z=0.034)",
"Agent collided against object with type=static.guardrail and id=0 at (x=5.249, y=201.018, z=0.04)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 13.90000020712614,
"duration_system": 56.08150243759155,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_28",
"scores": {
"score_composed": 42.25000000000001,
"score_penalty": 0.42250000000000004,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 29,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 9.300000138580799,
"duration_system": 33.888689279556274,
"route_length": 70.7106889082488
},
"route_id": "RouteScenario_29",
"scores": {
"score_composed": 100.0,
"score_penalty": 1.0,
"score_route": 100.0
},
"status": "Completed"
},
{
"index": 30,
"infractions": {
"collisions_layout": [
"Agent collided against object with type=static.guardrail and id=0 at (x=51.045, y=-200.472, z=0.034)",
"Agent collided against object with type=static.guardrail and id=0 at (x=-2.015, y=201.206, z=0.033)"
],
"collisions_pedestrian": [],
"collisions_vehicle": [
"Agent collided against object with type=vehicle.tesla.cybertruck and id=7561 at (x=61.317, y=-201.295, z=0.033)"
],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": [
"Agent got blocked at (x=-1.209, y=201.144, z=0.035)"
]
},
"meta": {
"duration_game": 371.80000554025173,
"duration_system": 1472.998898267746,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_30",
"scores": {
"score_composed": 24.128746038038006,
"score_penalty": 0.2535,
"score_route": 95.18243013032743
},
"status": "Failed - Agent got blocked"
},
{
"index": 31,
"infractions": {
"collisions_layout": [],
"collisions_pedestrian": [],
"collisions_vehicle": [],
"outside_route_lanes": [],
"red_light": [],
"route_dev": [],
"route_timeout": [],
"stop_infraction": [],
"vehicle_blocked": []
},
"meta": {
"duration_game": 29.200000435113907,
"duration_system": 109.11541223526001,
"route_length": 70.71067811865476
},
"route_id": "RouteScenario_31",
"scores": {
"score_composed": 100.0,
"score_penalty": 1.0,
"score_route": 100.0
},
"status": "Completed"
}
]
},
"eligible": true,
"entry_status": "Finished with agent errors",
"labels": [
"Avg. driving score",
"Avg. route completion",
"Avg. infraction penalty",
"Collisions with pedestrians",
"Collisions with vehicles",
"Collisions with layout",
"Red lights infractions",
"Stop sign infractions",
"Off-road infractions",
"Route deviations",
"Route timeouts",
"Agent blocked"
],
"sensors": [
"carla_camera",
"carla_camera",
"carla_camera",
"carla_camera",
"carla_lidar",
"carla_imu",
"carla_gnss",
"carla_speedometer"
],
"values": [
"59.378",
"85.886",
"0.717",
"0.000",
"1.023",
"2.872",
"0.805",
"0.283",
"3.686",
"0.000",
"3.236",
"0.316"
]
}

How to generate the file named CHECKPOINT_ENDPOINT

I trained part of the model using the data set provided on the web page, but in the validation part, the code needs to provide the JSON file of CHECKPOINT_ENDPOINT, I would like to ask how this is generated.

Some problem about data generation

After I deployed the operating environment, i run the
./leaderboard/scripts/run_evaluation.sh without any modify
then have an error

Problem reading checkpoint. Route id 60 larger than maximum number of routes 23
========= Preparing RouteScenario_0 (repetition 0) =========
> Setting up the agent
routes_town01_short_10_01_00_37_02
> Loading the world
> Running the route
Traceback (most recent call last):
File "/home/harli/transfuser-main/leaderboard/leaderboard/scenarios/scenario_manager.py", line 152, in _tick_scenario
ego_action = self._agent()
File "/home/harli/transfuser-main/leaderboard/leaderboard/autoagents/agent_wrapper.py", line 82, in call
return self._agent()
File "/home/harli/transfuser-main/leaderboard/leaderboard/autoagents/autonomous_agent.py", line 115, in call
control = self.run_step(input_data, timestamp)
File "leaderboard/team_code/auto_pilot.py", line 177, in run_step
self.save(far_node, near_command, steer, throttle, brake, target_speed, data)
TypeError: save() missing 1 required positional argument: 'tick_data'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "leaderboard/leaderboard/leaderboard_evaluator.py", line 477, in main
leaderboard_evaluator.run(arguments)
File "leaderboard/leaderboard/leaderboard_evaluator.py", line 414, in run
self._load_and_run_scenario(args, config)
File "leaderboard/leaderboard/leaderboard_evaluator.py", line 351, in _load_and_run_scenario
self.manager.run_scenario()
File "/home/harli/transfuser-main/leaderboard/leaderboard/scenarios/scenario_manager.py", line 136, in run_scenario
self._tick_scenario(timestamp)
File "/home/harli/transfuser-main/leaderboard/leaderboard/scenarios/scenario_manager.py", line 159, in _tick_scenario
raise AgentError(e)
leaderboard.autoagents.agent_wrapper.AgentError: save() missing 1 required positional argument: 'tick_data'

The server has an error after a few seconds

4.24.3-0+++UE4+Release-4.24 518 0
Disabling core dumps.
Signal 11 caught.
Malloc Size=65538 LargeMemoryPoolOffset=65554
CommonUnixCrashHandler: Signal=11
Malloc Size=65535 LargeMemoryPoolOffset=131119
Malloc Size=111328 LargeMemoryPoolOffset=242464
Engine crash handling finished; re-raising signal 11 for the default handler. Good bye.
Segmentation fault (core dumped)

I use the Ubuntu 20 and Nvidia1080Ti

Poor evaluation result

Hi! Thanks for your amazing work. I try to achieve the same performance as the paper shown, but now have some problems.

  1. In leaderboard/data/scenarios/town05_all_scenarios.json, I see that the last one has "scenario_type": "Scenario10". But in the evaluation log, I get these:
"meta": {
                "exceptions": [
                    [
                        "RouteScenario_16",
                        0,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_17",
                        1,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_18",
                        2,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_20",
                        4,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_21",
                        5,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_22",
                        6,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_23",
                        7,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_24",
                        8,
                        "Failed - Agent got blocked"
                    ],
                    [
                        "RouteScenario_25",
                        9,
                        "Failed - Agent got blocked"
                    ]
                ]
            },

I am wondering that what's the relationship between Scenario and RouteScenario?

  1. I evaluated the pre-trained model and a model trained by myself without any modification on your code. The results are:

Result of model_ckpt/geometric_fusion (pretrained)

Result of model_ckpt/transfuser (pretrained)

Result of transfuser (self-trained)

I think there is something wrong, because they are significantly poorer than the results in your paper. Could you find any possible mistakes?

Evaluation script used for pre-trained transfuser model:

#!/bin/bash

export CARLA_ROOT=carla
export CARLA_SERVER=${CARLA_ROOT}/CarlaUE4.sh
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI
export PYTHONPATH=$PYTHONPATH:${CARLA_ROOT}/PythonAPI/carla
export PYTHONPATH=$PYTHONPATH:$CARLA_ROOT/PythonAPI/carla/dist/carla-0.9.10-py3.7-linux-x86_64.egg
export PYTHONPATH=$PYTHONPATH:leaderboard
export PYTHONPATH=$PYTHONPATH:leaderboard/team_code
export PYTHONPATH=$PYTHONPATH:scenario_runner

export LEADERBOARD_ROOT=leaderboard
export CHALLENGE_TRACK_CODENAME=SENSORS
export PORT=2000 # same as the carla server port
export TM_PORT=8000 # port for traffic manager, required when spawning multiple servers/clients
export DEBUG_CHALLENGE=0
export REPETITIONS=1 # multiple evaluation runs
export ROUTES=leaderboard/data/evaluation_routes/routes_town05_long.xml
export TEAM_AGENT=leaderboard/team_code/transfuser_agent.py
export TEAM_CONFIG=model_ckpt/transfuser
export CHECKPOINT_ENDPOINT=results/transfuser_result_1203_V2.json
export SCENARIOS=leaderboard/data/scenarios/town05_all_scenarios.json
export SAVE_PATH=data/expert_TF1203_V2 # path for saving episodes while evaluating
export RESUME=True


python3 ${LEADERBOARD_ROOT}/leaderboard/leaderboard_evaluator.py \
--scenarios=${SCENARIOS}  \
--routes=${ROUTES} \
--repetitions=${REPETITIONS} \
--track=${CHALLENGE_TRACK_CODENAME} \
--checkpoint=${CHECKPOINT_ENDPOINT} \
--agent=${TEAM_AGENT} \
--agent-config=${TEAM_CONFIG} \
--debug=${DEBUG_CHALLENGE} \
--record=${RECORD_PATH} \
--resume=${RESUME} \
--port=${PORT} \
--trafficManagerPort=${TM_PORT}

Sequence length

Hi
Thanks for opening your code, very useful.
I noticed you implemented a seq_len parameter but you don't use it in the code or in your paper as I think all the models are single input image. I was wondering if you have played with this parameter with a sequence >1 and if you saw any difference?

Question about fps and rgb input

Thanks for your great work and quality code! I have the following questions.

  1. Seems that will cause
    if self.step < self.config.seq_len:
    rgb = torch.from_numpy(scale_and_crop_image(Image.fromarray(tick_data['rgb']), crop=self.config.input_resolution)).unsqueeze(0)
    self.input_buffer['rgb'].append(rgb.to('cuda', dtype=torch.float32))
    if not self.config.ignore_sides:
    rgb_left = torch.from_numpy(scale_and_crop_image(Image.fromarray(tick_data['rgb_left']), crop=self.config.input_resolution)).unsqueeze(0)
    self.input_buffer['rgb_left'].append(rgb_left.to('cuda', dtype=torch.float32))
    rgb_right = torch.from_numpy(scale_and_crop_image(Image.fromarray(tick_data['rgb_right']), crop=self.config.input_resolution)).unsqueeze(0)
    self.input_buffer['rgb_right'].append(rgb_right.to('cuda', dtype=torch.float32))
    if not self.config.ignore_rear:
    rgb_rear = torch.from_numpy(scale_and_crop_image(Image.fromarray(tick_data['rgb_rear']), crop=self.config.input_resolution)).unsqueeze(0)
    self.input_buffer['rgb_rear'].append(rgb_rear.to('cuda', dtype=torch.float32))
    self.input_buffer['lidar'].append(tick_data['lidar'])
    self.input_buffer['gps'].append(tick_data['gps'])
    self.input_buffer['thetas'].append(tick_data['compass'])
    control = carla.VehicleControl()
    control.steer = 0.0
    control.throttle = 0.0
    control.brake = 0.0
    return control
    to always jump over the first frame no matter self.config.seq_len, this seems no big deal but I want to confirm if this is intentional since this part of the code is not needed at all when self.config.seq_len=1.
  2. From what I understand, the leaderboard runs at 20 FPS. I don't understand why we get one lidar each two frames
    #Only predict every second step because we only get a LiDAR every second frame.
  3. I don't understand why you specifically set the sampling rate for some sensors instead of using the default system frequency (20 FPS)
    {
    'type': 'sensor.other.imu',
    'x': 0.0, 'y': 0.0, 'z': 0.0,
    'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0,
    'sensor_tick': 0.05,
    'id': 'imu'
    },
    {
    'type': 'sensor.other.gnss',
    'x': 0.0, 'y': 0.0, 'z': 0.0,
    'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0,
    'sensor_tick': 0.01,
    'id': 'gps'
    },
    {
    'type': 'sensor.speedometer',
    'reading_frequency': 20,
    'id': 'speed'
    }
  4. I saved the picture taken by the front camera during inference and found that there seem to be black waypoints on the picture (visualization of navigation), I want to ask is this normal? Why are they there and can they be removed?
    test
    Thanks again!

Hi, some questions about the model!

Hi, Thanks for this nice work. Recently, I am trying to modify this excellent model to make it suit for my work. As you see, why the "average" operation is required here, the shape of the tensor changes from 6464 to 88 after the "average" operation. However, the shape of the tensor should be the 64*64 just like the description" fusion at (B,64,64,64)".
QQ截图20211202152824

About data generation

Hello! I have some problems about the data generation.
My operation process is:

  1. Running CARLA Server
    image
  2. ./leaderboard/scripts/run_evaluation.sh
    image
    This seems that data generation is not successful. I would like to ask if the above operation is correct, and what should I do if there is a problem.
    And I understand that some images should be generated in the end, where will they be stored?
    I would be very grateful if you could reply.

How to realize the attention maps?

Hi, thanks for your wonderful work especially the detailed code! But I am confused and have some questions about the attention maps. I only have a general understanding of the mechanism of Tranformer. I want to know how to understand the tokens mapping between images and lidar. Specifically,

  1. In the supplementary, I think these are the same two scenarios, but the green areas appear in two different places when you query the traffic lights in the same location. How do you explain this phenomenon?
    1646912193(1)

  2. Also, in the circled scene above, does the green area in the lidar map change if the traffic light in the image is red? That is to say, does agent's focus change as the traffic lights change?

  3. Finally, I just feel confused and can you explain why the lidar is mapped to this location in a situation like this?
    image

Thank you in advance for your answer!

Validation

Hello, I was training a model I wrote using your 14 weather minimal dataset
The training loss decreased through epochs
But validation loss kept decreasing and increasing
It ranged from 0.26 to 0.38
Did the same happen to you ? And does that mean that the model is not learning?

Some questions about hyperparameters

Hi! First of all I love the work you've with the TransFuser project, it's really quite interesting and I've had fun diving into autonomous driving research with CARLA thanks to you and your team, so thank you for that!
Currently I am trying to replicate your results and also tune the hyperparameters of the transfuser model so I have a few questions with respect to that.

  1. I see that in all of the train.py scripts for all of the models, the --epochs parameter is set to a default value of 101 except for CILRS which is set to 201, however in the supplementary material you mention that all of the models were trained for 101 epochs. Was the CILRS model really trained at 201 epochs or why is it the only model set to that default value?

  2. In the README for each model you give an example of how to train that model, for example,
    CUDA_VISIBLE_DEVICES=<gpu_id> python3 train.py --id transfuser --batch_size 56 and
    CUDA_VISIBLE_DEVICES=<gpu_id> python3 train.py --id late_fusion --batch_size 128
    I see that for different models you provide different values for --batch_size in those examples, however the default values are all set to 24 if I'm not mistaken. What batch size did you use for producing the results found in your main paper? Did you use the same values for all of the models or, like in the examples provided, use different values for different models?

  3. During the training process, the model validates itself every 5 epochs, is this so that it can autostop if there's no improvement after a certain number of epochs or what is the reason for this validation? If this is the case, then there wouldn't be much of a need to tune the epochs parameters, correct?

  4. From what I can tell, the main tunable parameters when calling the train.py script are --epochs, --lr (learning rate), and --batch_size. Do you have any suggestions/recommendations as to how I can go about trying to tune these? Also, are there any other parameters that I didn't mention that could also be fun to experiment with to try to optimize the transfuser model?

about evaluation issues

Hi, I got some issues during evaluation.

  1. I got 'list index out of range' error in 'Loading the world'. How can I solve it?
    Screenshot from 2021-09-08 18-33-24

  2. I have often witnessed that vehicles around the ego vehicle sometimes stop without moving and end without proceeding. It seems to occur mainly in the right turn lane. I think this is not a matter of training, but an auto pilot algorithm problem for around vehicles. How can I solve this problem?

This is an example picture of the vehicle stopping and not moving.
Screenshot from 2021-09-08 18-30-58

Thank you.

Data preprocessing problems

Hi,Thanks for your great work!
I was wondering what local coordinates are in the code for Transfuse Data? Also, why is the range of X_bins [-32,33] when the point cloud transforms into BEV?

A data generation problem

Hi, when I use the autopilot to start data generation, I get a "failure" as the following picture:
Uploading 2021-12-23 19-24-01屏幕截图.png…
I know this problem is common, but I worry it will affect the final result of model training since we imitate an imperfect expert. How do you think about this?

No module names cirl

Hi, could you please check if there is the "model_ckpt/cirls" file? I run the CIRLS agent and downloaded the model_ckpt file but there is no "cirls" under the file.

image

Also, this is the error information:
image

Best
Thanks!

I'd like to know some detailed options for training and testing.

First of all, thank you for providing a good code and paper.
I have some questions about details of the code.

  1. In the "Global config" code, only 'tiny' and 'short' are included in the training and 'long' are not included, is this intended? Can I add the rest of long town except Town 5? Did you take it off to prevent overfitting?

  2. The results of my training and testing will not be completely consistent with your paper, but I want to make sure how similar they are. Can I know what the three seeds used for training are? If it's difficult to tell, wouldn't it matter if I use three seeds arbitrarily?

2-1. In order to change the random seed, which part of the training code should I modify?

Thank you.

Hi,when I run viz.py

Thanks for pointing this out. I have added the attention map visualization code.

We visualize the attention maps from the last attention layer for each of the four heads on a subset of Town05_tiny data since it contains lots of intersections. The main change in the model (model_viz.py) is to return the attention maps along with the waypoint predictions.

Let me know if there are any issues with running the code.

Originally posted by @ap229997 in #18 (comment)

Problem about training

When I execute the instruction——"CUDA_VISIBLE_DEVICES=1 python3 train.py --id transfuser --batch_size 56, I meet an error:

Traceback (most recent call last):
File "train.py", line 208, in
train_set = CARLA_Data(root=config.train_data, config=config)
File "/home/user/transfuser/transfuser/data.py", line 61, in init
root_files = os.listdir(sub_root)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/qb/geiger/kchitta31/data_06_21/Town01_tiny'

I look forward to your answer, thanks

Nvidia requirement

Is it possible to run these agents on a laptop that doesn't have Nvidia gpu ?

Traffic light in the image

Thank you very much for sharing your great work and data. I generated some data using your script and I noticed that usually the traffic light in the image is very small (sometimes even hard for me to distinguish). Is it the common case or I have some wrong settings?

Problem when run run_evaluation.sh

I change agent = transfuser_ agent and agent_ config=best_ model.pth you provided, but the following error occurred. According to the prompt, the torch version should be too low. I upgraded the torch version but reported another error.

Problem reading checkpoint. Route id 60 larger than maximum number of routes 32

========= Preparing RouteScenario_0 (repetition 0) =========
> Setting up the agent

Could not set up the required agent:
> version_ <= kMaxSupportedFileFormatVersion INTERNAL ASSERT FAILED at /pytorch/caffe2/serialize/inline_container.cc:132, please report a bug to PyTorch. Attempted to read a PyTorch file with version 3, but the maximum supported version for reading is 2. Your PyTorch installation may be too old. (init at /pytorch/caffe2/serialize/inline_container.cc:132)
frame #0: c10::Error::Error(c10::SourceLocation, std::string const&) + 0x33 (0x7f971843c193 in /home/harli/anaconda3/envs/transfuser/lib/python3.7/site-packages/torch/lib/libc10.so)
frame #1: caffe2::serialize::PyTorchStreamReader::init() + 0x1f5b (0x7f96cb7319eb in /home/harli/anaconda3/envs/transfuser/lib/python3.7/site-packages/torch/lib/libtorch.so)
frame #2: caffe2::serialize::PyTorchStreamReader::PyTorchStreamReader(std::string const&) + 0x64 (0x7f96cb732c04 in /home/harli/anaconda3/envs/transfuser/lib/python3.7/site-packages/torch/lib/libtorch.so)
frame #3: + 0x6c6536 (0x7f9713663536 in /home/harli/anaconda3/envs/transfuser/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
frame #4: + 0x295a74 (0x7f9713232a74 in /home/harli/anaconda3/envs/transfuser/lib/python3.7/site-packages/torch/lib/libtorch_python.so)
frame #5: _PyMethodDef_RawFastCallDict + 0x24c (0x5629eeae871c in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #6: _PyObject_FastCallDict + 0x6e (0x5629eeab8f5e in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #7: + 0x12f041 (0x5629eeace041 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #8: PyObject_Call + 0x66 (0x5629eeab97b6 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #9: + 0xc239e (0x5629eea6139e in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #10: _PyObject_FastCallKeywords + 0x54c (0x5629eeb1ec7c in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #11: + 0x1802d1 (0x5629eeb1f2d1 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #12: _PyEval_EvalFrameDefault + 0x48a2 (0x5629eeb66602 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #13: _PyEval_EvalCodeWithName + 0x79e (0x5629eeab80de in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #14: _PyObject_FastCallDict + 0x312 (0x5629eeab9202 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #15: + 0x186bef (0x5629eeb25bef in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #16: _PyObject_FastCallKeywords + 0x54c (0x5629eeb1ec7c in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #17: _PyEval_EvalFrameDefault + 0x47e5 (0x5629eeb66545 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #18: _PyEval_EvalCodeWithName + 0x273 (0x5629eeab7bb3 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #19: _PyFunction_FastCallKeywords + 0x693 (0x5629eead8223 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #20: + 0x1800c5 (0x5629eeb1f0c5 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #21: _PyEval_EvalFrameDefault + 0x48a2 (0x5629eeb66602 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #22: _PyFunction_FastCallKeywords + 0x187 (0x5629eead7d17 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #23: + 0x1800c5 (0x5629eeb1f0c5 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #24: _PyEval_EvalFrameDefault + 0x621 (0x5629eeb62381 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #25: _PyObject_FastCallDict + 0x1b6 (0x5629eeab90a6 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #26: + 0x186bef (0x5629eeb25bef in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #27: _PyObject_FastCallKeywords + 0x54c (0x5629eeb1ec7c in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #28: _PyEval_EvalFrameDefault + 0x47e5 (0x5629eeb66545 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #29: _PyFunction_FastCallKeywords + 0x187 (0x5629eead7d17 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #30: + 0x1800c5 (0x5629eeb1f0c5 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #31: _PyEval_EvalFrameDefault + 0x621 (0x5629eeb62381 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #32: _PyFunction_FastCallKeywords + 0x187 (0x5629eead7d17 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #33: + 0x1800c5 (0x5629eeb1f0c5 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #34: _PyEval_EvalFrameDefault + 0x621 (0x5629eeb62381 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #35: _PyFunction_FastCallKeywords + 0x187 (0x5629eead7d17 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #36: _PyEval_EvalFrameDefault + 0x3f5 (0x5629eeb62155 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #37: _PyEval_EvalCodeWithName + 0x273 (0x5629eeab7bb3 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #38: PyEval_EvalCode + 0x23 (0x5629eeab8ee3 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #39: + 0x227802 (0x5629eebc6802 in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #40: PyRun_FileExFlags + 0x9e (0x5629eebd094e in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #41: PyRun_SimpleFileExFlags + 0x1bb (0x5629eebd0b3b in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #42: + 0x232c3a (0x5629eebd1c3a in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #43: _Py_UnixMain + 0x3c (0x5629eebd1ccc in /home/harli/anaconda3/envs/transfuser/bin/python)
frame #44: __libc_start_main + 0xf3 (0x7f979e49c0b3 in /lib/x86_64-linux-gnu/libc.so.6)
frame #45: + 0x1d7555 (0x5629eeb76555 in /home/harli/anaconda3/envs/transfuser/bin/python)

Hello, I want to know what ‘3 training seeds’ mean, can you talk about it in detail?

We report the mean and standard deviation over 9 runs of each method (3 training seeds,
each trained model evaluated 3 times) on Route Completion (RC) and Driving Score (DS) in Town05 Short and Town05
Long settings with scenario and without scenarios. LF: Late Fusion, GF: Geometric Fusion, TF: TransFuser

Hello, I want to know what ‘3 training seeds’ mean, can you talk about it in detail?

How to interpret data?

Hello, I want to know how to interpret 2d_bbs and 3d_bbs.

I see that lidar can be reshaped to (-1,4), but I wonder how 2d_bbs and 3d_bbs should be converted and how they should be interpreted.

Thank you!

I found that the lidar input of the network model seems to be wrong

I ran this set of codes and found that the lidar point cloud would flicker during the process of displaying the point cloud input. After careful exploration, it seems that the slow rotation frequency of the lidar sensor causes the input of the point cloud to alternate between one frame before and one frame after. I think this is wrong. In order to verify it, I tried without laser point cloud input. The effect of the network model does not seem to be affected, which is very unreasonable.I doubled the rotation frequency and this phenomenon will be corrected. Can you explain it to me? Did I make a mistake somewhere?

About target point in training and testing

Hi, I noticed that when you are collecting training data using autopilot, your target point are the far_nodes coming from _command_planner. However, when your actual model based agent is tested, it uses the _waypoint_planner to get target point which corresponds to near node. I think it is better to use the near nodes both for training and testing? Or do I miss something?

Dataset

Hello
Which dataset did you use in training to get the weights in model-ckpt?
Is it 14-weathers-minimal-dataset ?

Failed to build docker for leaderboard

Hello,
Thank you for the wonderful code! I have downloaded and successfully test for evaluation. Now I want to learn how to use the leaderboard for online evaluation. The official documents are not are not detailed enough. However, the code in your leaderboard helps me understand the how to use the dockerfile to build a docker. Then I have checked the make_docker.sh, it seems that I need to set the enviroment first.
So the enviroment is set as follows:

export CARLA_ROOT=/home/shy/Desktop/carla0.9.10.1
export LEADERBOARD_ROOT=/home/shy/Desktop/transfuser/leaderboard
export SCENARIO_RUNNER_ROOT=/home/shy/Desktop/transfuser/scenario_runner
export TEAM_CODE_ROOT=/home/shy/Desktop/transfuser/leaderboard/team_code

Then I tried to run sh make_docker.sh and it shows as follows:

mv: target '.tmp/PythonAPI/carla/dist/carla-leaderboard.egg' is not a directory
cp: cannot copy a directory, '/home/shy/Desktop/transfuser/leaderboard/', into itself, '.tmp/leaderboard'
Sending build context to Docker daemon  160.6MB
Step 1/38 : FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
9.0-cudnn7-devel-ubuntu16.04: Pulling from nvidia/cuda
4007a89234b4: Pull complete 
c1de0f9cdfc1: Pull complete 
c8ee6ca703b8: Pull complete 
b39e2761d3d4: Pull complete 
6fd4d5fe5247: Pull complete 
a2aa5ab1b28d: Pull complete 
d115189e3588: Pull complete 
c208532c0f67: Pull complete 
822dc7c71a4b: Pull complete 
05d21eb076f4: Pull complete 
b62c22f14976: Pull complete 
Digest: sha256:eb0f7d58b15893c7d3d676d23e9a4abaaaa6c09019f24bce29a448a9b8a261d8
Status: Downloaded newer image for nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
 ---> 7b3673a81378
......
......
#
# To activate this environment, use
#
#     $ conda activate python37
#
# To deactivate an active environment, use
#
#     $ conda deactivate

Removing intermediate container 680b222f6271
 ---> 23199a322ea1
Step 11/38 : RUN packages='py_trees==0.8.3 shapely six dictor requests ephem tabulate' 	&& pip3 install ${packages}
 ---> Running in 9e4b3fc610a9
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal.cli.main import main
  File "/usr/local/lib/python3.5/dist-packages/pip/_internal/cli/main.py", line 58
    sys.stderr.write(f"ERROR: {exc}")
                                   ^
SyntaxError: invalid syntax
Removing intermediate container 9e4b3fc610a9
The command '/bin/sh -c packages='py_trees==0.8.3 shapely six dictor requests ephem tabulate' 	&& pip3 install ${packages}' returned a non-zero code: 1

In the mv, it seems that the program failed to move the file and renamed it, only move the file here. And finally in the py_trees, I donot know how to fix this bug and after changing another computer, the same error comes.

About the expert in the result

Hi, I want to know that the expert with so high score in the result is because of its privileged information? I guess the expert is the agent from the first stage of the LBC.

Evaluation result

Dear Authors,

Thank you for your excellent work,

I trained the model with: CUDA_VISIBLE_DEVICES=0 python train.py --id transfuser --batch_size 56

And then I evaluate the model with: run_evaluation.sh

export ROUTES=leaderboard/data/evaluation_routes/routes_town05_long.xml
export TEAM_AGENT=leaderboard/team_code/transfuser_agent.py
export TEAM_CONFIG=transfuser/log/transfuser
export CHECKPOINT_ENDPOINT=results/transfuser_result.json
export SCENARIOS=leaderboard/data/scenarios/town05_all_scenarios.json

Finally, I got the results as
"labels": [
"Avg. driving score",
"Avg. route completion",
"Avg. infraction penalty",
"Collisions with pedestrians",
"Collisions with vehicles",
"Collisions with layout",
"Red lights infractions",
"Stop sign infractions",
"Off-road infractions",
"Route deviations",
"Route timeouts",
"Agent blocked"
],
"values": [
"19.388",
"51.060",
"0.539",
"0.000",
"0.472",
"0.000",
"0.221",
"0.008",
"0.008",
"0.000",
"0.000",
"0.999"
]

Is this Avg. driving score normal as I trained with the 14_weathers_minimal_data?

I noticed that the DS should be around 33% in the paper, would you please give me some suggestions about which part I made mistakes in.

Best

Question about the version of the dataset provided for downloading.

Thanks for the awesome work!

I have a question regarding to the dataset. In Transfuser+ it proposed a new agent named 'SEED' and regenerated a training dataset using 'SEED'. So I'd like to know whether the dataset provided for downloading in this repo is the one generated by Transfuser+'s 'SEED', or it is the one generated by original Transfuser Agent?

Thanks in advance :).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.