Giter Club home page Giter Club logo

neat's Introduction

NEAT: Neural Attention Fields for End-to-End Autonomous Driving

This repository is for the ICCV 2021 paper NEAT: Neural Attention Fields for End-to-End Autonomous Driving.

@inproceedings{Chitta2021ICCV,
  author = {Chitta, Kashyap and Prakash, Aditya and Geiger, Andreas},
  title = {NEAT: Neural Attention Fields for End-to-End Autonomous Driving},
  booktitle = {International Conference on Computer Vision (ICCV)},
  year = {2021}
}

Setup

Please follow the installation instructions from our TransFuser repository to set up the CARLA simulator. The conda environment required for NEAT can be installed via:

conda env create -f environment.yml
conda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c nvidia

For running the AIM-VA baseline, you will additionally need to install MMCV and MMSegmentation.

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
pip install mmsegmentation

Data Generation

The training data is generated using leaderboard/team_code/auto_pilot.py. Data generation requires routes and scenarios. Each route is defined by a sequence of waypoints (and optionally a weather condition) that the agent needs to follow. Each scenario is defined by a trigger transform (location and orientation) and other actors present in that scenario (optional). We provide several routes and scenarios under leaderboard/data/. The TransFuser repository and leaderboard repository provide additional routes and scenario files.

Running a CARLA Server

With Display

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

Without Display

Without Docker:

SDL_VIDEODRIVER=offscreen SDL_HINT_CUDA_DEVICE=0 ./CarlaUE4.sh --world-port=2000 -opengl

With Docker:

Instructions for setting up docker are available here. Pull the docker image of CARLA 0.9.10.1 docker pull carlasim/carla:0.9.10.1.

Docker 18:

docker run -it --rm -p 2000-2002:2000-2002 --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 carlasim/carla:0.9.10.1 ./CarlaUE4.sh --world-port=2000 -opengl

Docker 19:

docker run -it --rm --net=host --gpus '"device=0"' carlasim/carla:0.9.10.1 ./CarlaUE4.sh --world-port=2000 -opengl

If the docker container doesn't start properly then add another environment variable -e SDL_AUDIODRIVER=dsp.

Running the Autopilot

Once the CARLA server is running, rollout the autopilot to start data generation.

./leaderboard/scripts/run_evaluation.sh

The expert agent used for data generation is defined in leaderboard/team_code/auto_pilot.py. Different variables which need to be set are specified in leaderboard/scripts/run_evaluation.sh. The expert agent is originally based on the autopilot from this codebase.

Training

The training code and pretrained models are provided below.

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

There are 5 pretrained models provided in model_ckpt/:

Additional baselines are available in the TransFuser repository.

Evaluation

Spin up a CARLA server (described above) and run the required agent. The required variables need to be set in leaderboard/scripts/run_evaluation.sh.

CUDA_VISIBLE_DEVICES=0 ./leaderboard/scripts/run_evaluation.sh

Acknowledgements

This implementation primarily extends the cvpr2021 branch of the existing TransFuser repository.

If you found our work interesting, check out the code for some more recent work on CARLA from our group:

neat's People

Contributors

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

neat's Issues

Where can I download dataset for training?

Thank you for providing a good code.
Where can I download dataset for training?
I referred to the config.py, but it seems to be different from the transfuser dataset. Transfuser provides Town0x_long, Town0x_short, and Town0x_tiny but it requires Town0x, Town0x_long, and Town0x_small.

Data Generation via `run_evaluation.sh`

Hi,
Thanks for the amazing work!
I followed the Data Generation section in README.md(I did not modify any configurations and just activated the export of SAVE_PATH in the script).
The following video shows the generated front images:

temp_

| As shown in the above video, the weather is changing, and this example(as one RouteScenario) consists of 94 frames (Different scenarios have different frames).

For some scenarios, they met the failures like the followings:
Snipaste_2022-02-08_23-57-16

Does it work? Is there anything wrong with this?

Effects of semantic

Thanks for the work and the open source code. In the controller, I know that the use of red light for the longitudinal controller. But what if just use raw data input of RGB to identify instead of semantic? Could you please tell me the affect of the semantic? That is I think the semantic is just use to identify the traffic light.

Porting NEAT to BeamNG.tech

Dear All,

I am a student working on a project involving testing ADAS/AV and scenario synthesis using BeamNG.tech and would love to run (test) your driving agent in that simulator. I know CARLA is kind of a de facto standard, but IMHO BeamNG.tech is superior when it comes to physic simulation, content, and flexibility. Further, BeamNG.tech is free for research, offers a python API, just like CARLA, and implements a wide range of sensors.

So I wonder how technically difficult it would be to port NEAT to BeamNG.tech and whether anyone of you could support me (and my colleagues) in doing so. Hope to hear from you soon,

Thanks!

-- Benedikt Steininger

How to generate training data for different model

Hi,
Thanks for the interesting work !

I follow the step of Data Generation provides in the README file, "./leaderboard/scripts/run_evaluation.sh" to run the Autopilot.
But I havesome questions,as the following :
(1) this process is only to evaluate the performance of different agents on the defined routes. No data was generated.
(2) different models (agent) need different types of data. I want to know how to generate training data for different models.

Any tips would be helpful.

Thanks in advance!

The gpu-Util is low

I try to train the model but the GPU-Util is only 20% with cuda 10.1 and torch 1.7. Is that normal?

train error

1691029141921
We encountered such an error while running the training. May I ask why?

4 waypoints used instead of 5?

Hi,
I am taking a look at your code and I noticed you predict 5 waypoints in the decoder network, but you only use 4 waypoints for actually controlling the car. You do not use the first predicted waypoint and I was wondering why you would do that.

Thanks in advance!

How to visualize the semantic segmentation results on Bev?

Hello,
It seems that
You sampled 64 points for 5 different categories during data set preprocessing, but in fact, the semantic segmentation in Bev is a dense prediction task. For example, in a range of 200 * 200 pixels, 40000 points need to be sampled, so how to process and visualize the results in the inference stage?

Irregular shape of BEV

Hi @kashyap7x , thanks for your wonderful work on NEAT. I would like to ask regarding the blobby nature of BEV output as compared to other BEV methods like LSS or Fiery, where BEV of vehicles is quite sharp. Can you tell some pointers on how we can improve this irregular vehicle bev coming in NEAT?

image

Thanks

FileNotFoundError: [Errno 2] No such file or directory: '../carla_results/auto_pilot.json'

when i Running the Autopilot

./leaderboard/scripts/run_evaluation.sh

i accept this error :

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 406, in run
self.statistics_manager.clear_record(args.checkpoint)
File "/home/ev/Net/carla_prj/neat/leaderboard/leaderboard/utils/statistics_manager.py", line 340, in clear_record
with open(endpoint, 'w') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '../carla_results/auto_pilot.json'
Exception ignored in: <function LeaderboardEvaluator.del at 0x7fe8e9a8a9e0>

can you help? thank you very much

Error while data generation

Hi, I want to generate data and I am using CARLA build from source. When I run command "./leaderboard/scripts/run_evaluation.sh", I am getting this error. How to resolve this. I have not changed anything in any file.
Any help please!!!

leaderboard/leaderboard/leaderboard_evaluator.py:24: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources
WARNING: Version mismatch detected: You are trying to connect to a simulator that might be incompatible with this API
WARNING: Client API version = 0.9.14
WARNING: Simulator API version = 0.9.14-6-g43b5e7064-dirty
leaderboard/leaderboard/leaderboard_evaluator.py:91: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(dist.version) < LooseVersion('0.9.10'):
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 406, in run
self.statistics_manager.clear_record(args.checkpoint)
File "/neat-main/leaderboard/leaderboard/utils/statistics_manager.py", line 340, in clear_record
with open(endpoint, 'w') as fd:
FileNotFoundError: [Errno 2] No such file or directory: '../carla_results/auto_pilot.json'
Exception ignored in: <function LeaderboardEvaluator.del at 0x7f3902afbf70>
Traceback (most recent call last):
File "leaderboard/leaderboard/leaderboard_evaluator.py", line 124, in del
self._cleanup()
File "leaderboard/leaderboard/leaderboard_evaluator.py", line 157, in _cleanup
self._agent_watchdog.stop()
File "/neat-main/scenario_runner/srunner/scenariomanager/watchdog.py", line 72, in stop
self._timer.cancel()
AttributeError: 'NoneType' object has no attribute 'cancel'

Local_evaluation.sh on CARLA42routes

When I run Local_evaluation.sh, the following error will be reported in Town01 map. Can you give me some ideas to solve the problem?
`========= Preparing RouteScenario_1 (repetition 0) =========

Setting up the agent
.//model_ckpt/transfuser/model_seed1_39.pth
Loading the world
No more spawn points to use. Spawned 256 actors out of 500
Running the route
/home/sunyyyy/anaconda3/envs/tfuse/lib/python3.7/site-packages/mmdet/models/utils/gaussian_target.py:227: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
topk_clses = topk_inds // (height * width)
/home/sunyyyy/anaconda3/envs/tfuse/lib/python3.7/site-packages/mmdet/models/utils/gaussian_target.py:229: UserWarning: floordiv is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').
topk_ys = topk_inds // width
WARNING: attempting to destroy an actor that is already dead: Actor 441 (vehicle.audi.tt)
Destroying ego-vehicle!
Trying to remove a non-existing actor id 441
Resetting ego-vehicle!

Error during the simulation:

trying to operate on a destroyed actor; an actor's function was called, but the actor is already destroyed.

Traceback (most recent call last):
File ".//leaderboard/leaderboard/leaderboard_evaluator_local.py", line 351, in _load_and_run_scenario
self.manager.run_scenario()
File "/home/sunyyyy/桌面/transfuser/leaderboard/leaderboard/scenarios/scenario_manager_local.py", line 136, in run_scenario
self._tick_scenario(timestamp)
File "/home/sunyyyy/桌面/transfuser/leaderboard/leaderboard/scenarios/scenario_manager_local.py", line 164, in _tick_scenario
self.scenario_tree.tick_once()
File "/home/sunyyyy/anaconda3/envs/tfuse/lib/python3.7/site-packages/py_trees/behaviour.py", line 158, in tick_once
for unused in self.tick():
File "/home/sunyyyy/anaconda3/envs/tfuse/lib/python3.7/site-packages/py_trees/composites.py", line 578, in tick
for node in child.tick():
File "/home/sunyyyy/anaconda3/envs/tfuse/lib/python3.7/site-packages/py_trees/composites.py", line 578, in tick
for node in child.tick():
File "/home/sunyyyy/anaconda3/envs/tfuse/lib/python3.7/site-packages/py_trees/behaviour.py", line 249, in tick
new_status = self.update()
File "/home/sunyyyy/桌面/transfuser/scenario_runner/srunner/scenariomanager/scenarioatomics/atomic_criteria_local.py", line 2000, in update
location = self._actor.get_location()
RuntimeError: trying to operate on a destroyed actor; an actor's function was called, but the actor is already destroyed.

Stopping the route
Resetting ego-vehicle!

========= Results of RouteScenario_1 (repetition 0) ------ FAILURE =========

╒═════════════════════════════════╤═════════════════════╕
│ Start Time │ 2023-03-01 17:22:19 │
├─────────────────────────────────┼─────────────────────┤
│ End Time │ 2023-03-01 17:27:53 │
├─────────────────────────────────┼─────────────────────┤
│ Duration (System Time) │ 333.89s │
├─────────────────────────────────┼─────────────────────┤
│ Duration (Game Time) │ 157.65s │
├─────────────────────────────────┼─────────────────────┤
│ Ratio (System Time / Game Time) │ 0.472 │
╘═════════════════════════════════╧═════════════════════╛

╒═══════════════════════╤═════════╤═════════╕
│ Criterion │ Result │ Value │
├───────────────────────┼─────────┼─────────┤
│ RouteCompletionTest │ FAILURE │ 33.62 % │
├───────────────────────┼─────────┼─────────┤
│ OutsideRouteLanesTest │ SUCCESS │ 0 % │
├───────────────────────┼─────────┼─────────┤
│ CollisionTest │ FAILURE │ 6 times │
├───────────────────────┼─────────┼─────────┤
│ RunningRedLightTest │ SUCCESS │ 0 times │
├───────────────────────┼─────────┼─────────┤
│ RunningStopTest │ SUCCESS │ 0 times │
├───────────────────────┼─────────┼─────────┤
│ InRouteTest │ SUCCESS │ │
├───────────────────────┼─────────┼─────────┤
│ AgentBlockedTest │ SUCCESS │ │
├───────────────────────┼─────────┼─────────┤
│ Timeout │ SUCCESS │ │
╘═══════════════════════╧═════════╧═════════╛

Registering the route statistics
ERROR: failed to destroy actor 560 : unable to destroy actor: not found
ERROR: failed to destroy actor 568 : unable to destroy actor: not found
ERROR: failed to destroy actor 624 : unable to destroy actor: not found
ERROR: failed to destroy actor 699 : unable to destroy actor: not found`

Error when I run "run_evaluation.sh"

Hi,
Thanks for the interesting work and well documentation!

I follow the instructions provided in the README file to run the Autopilot but I face the following errors:

  1. I got this error (pic below) when I tried to run "run_evaluation.sh", I solved this problem by creating a directory named "carla_results". Is this the right solution?

E1

  1. Now, I'm getting another error (pic below), what can be the problem?

E2

Any tips would be helpful.

Thanks in advance!

The dataset format

Hello,
Thank you for your great work
if I generate the dataset correctly, what will be its folder placement structure?
Could you give me an example?Just a screenshot is ok.

topdown

0010
Hi,I don't quite understand the effect of the topdown map, I can't see some map features. Can you explain it when you have time? Thank you!

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.