# Distributed Deep Reinforcement Learning for Autonomous Driving
### Authors:
**[Mitchell Spryn](https://www.linkedin.com/in/mitchell-spryn-57834545/)**, Software Engineer II, Microsoft
**[Aditya Sharma](https://www.linkedin.com/in/adityasharmacmu/)**, Program Manager, Microsoft
**[Dhawal Parkar](https://www.linkedin.com/in/dparkar/)**, Software Engineer II, Microsoft
## Overview
In this tutorial, you will learn how to train a distributed deep reinforcement learning model for autonomous driving leveraging the power of cloud computing. This tutorial serves as an introduction to training deep learning AD models at scale. Through the course of this tutorial you will learn how to set up a cluster of virtual machine nodes running the [AirSim simulation environment](https://github.com/Microsoft/AirSim) and then distribute a training job across the nodes to train a model to steer a car through the Neighborhood environment in AirSim using reinforcement learning. A visualization of this process on four such VM nodes can be seen below.
![car_driving_1](car_driving_1.gif)![car_driving_2](car_driving_2.gif)
![car_driving_3](car_driving_3.gif)![car_driving_4](car_driving_4.gif)
The instructions provided here use virtual machines spun up on [Microsoft Azure](https://azure.microsoft.com/en-us/) using the [Azure Batch](https://azure.microsoft.com/en-us/services/batch/) service to schedule the distribution job. The ideas presented however, can be easily extended to the cloud platform and services of your choice. Please also note that you should be able to work through the tutorial without having to actually run the given code and train the model. **If you do wish to run the code, you will need an active [Azure subscription](https://azure.microsoft.com/en-us/free/), and kicking off the training job will [incur charges](https://azure.microsoft.com/en-us/pricing/).**
#### Who is this tutorial for?
This tutorial was designed keeping autonomous driving practitioners in mind. Researchers as well as industry professionals working in the field will find this tutorial to be a good starting off point for further work. The focus of the tutorial is on teaching how to create autonomous driving models at scale from simulation data. While we use deep reinforcement learning to demonstrate how to train such models and the tutorial does go into model discussions, it assumes that readers are familiar with the mechanics of reinforcement learning. Beginners in the field, especially those who are new to deep learning, might find certain aspects of this tutorial challenging. Please refer to the Prerequisites section below for more details.
## Prerequisites and setup
#### Background needed
This tutorial was designed with advanced users and practitioners in mind, hence it assumes the reader has a background in deep learning, and is familiar with the basic concepts of reinforcement learning (reward functions, episodes etc.). A helpful introduction to reinforcement learning can be found [here](https://medium.freecodecamp.org/deep-reinforcement-learning-where-to-start-291fb0058c01).
It is also highly recommended that the reader has familiarity with the AirSim simulation platform. This tutorial builds upon certain concepts introduced in our [end-to-end deep learning for autonomous driving](../AirSimE2EDeepLearning/README.md) tutorial. We therefore recommend going through that tutorial first.
#### Environment Setup
1. [Install Anaconda](https://conda.io/docs/user-guide/install/index.html) with Python 3.5 or higher.
2. [Install Tensorflow](https://www.tensorflow.org/install/install_windows)
3. [Install h5py](http://docs.h5py.org/en/latest/build.html)
4. [Install Keras](https://keras.io/#installation)
5. [Install AzCopy](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy). Be sure to add the location for the AzCopy executable to your system path.
6. [Install the latest verison of Azure Powershell](https://docs.microsoft.com/en-us/powershell/azure/install-azurerm-ps?view=azurermps-5.3.0).
7. [Install the latest version of the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest).
8. Install the other dependencies. From your anaconda environment, run "InstallPackages.py" as root or administrator. This installs the following packages into your environment:
* jupyter
* matplotlib v. 2.1.2
* image
* keras_tqdm
* opencv
* msgpack-rpc-python
* pandas
* numpy
* scipy
#### Simulator Package
We have created a standalone build of the AirSim simulation environment for the tutorials in this cookbook. [You can download the build package from here](https://airsimtutorialdataset.blob.core.windows.net/e2edl/AD_Cookbook_AirSim.7z). Consider using [AzCopy](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy), as the file size is large. After downloading the package, unzip it and run the PowerShell command
`
.\AD_Cookbook_Start_AirSim.ps1 neighborhood
`
to start the simulator in the neighborhood environment.
#### Hardware
This tutorial has been designed to run on Azure Batch using NV6 machines. Training times and charges vary depending on the number of machines that are spun up. Using a cluster size of 4 (i.e. 3 agent nodes and 1 parameter server node), the model took 3 days to train from scratch. Using transfer learning, the model trained in 6 hours. Using a large cluster size will result in a decreased training time, but will also incur additional charges.
For demonstration purposes, the model can also be trained on a single machine (see instructions below). The model can take up to 5 days to train from scratch, but can train in a few hours using transfer learning. To train the model locally, a machine with a GPU is required.
Running the final trained model requires a GPU. This can either be a local machine, or an NV-Series [Azure Data Science VM](https://azure.microsoft.com/en-us/services/virtual-machines/data-science-virtual-machines/).
## Structure of the tutorial
You will follow a series of [Jupyter notebooks](https://jupyter-notebook.readthedocs.io/en/stable/index.html) as you make your way through this tutorial. Please start with the [first notebook to set up your cluster](SetupCluster.ipynb) and proceed through the notebooks in the following order:
Step 0: [Set up the cluster](SetupCluster.ipynb)
Step 1: [Explore the algorithm](ExploreAlgorithm.ipynb)
Step 2: [Launch the training job](LaunchTrainingJob.ipynb)
Step 3: [Run the model](RunModel.ipynb)
If you wish to train the model locally, proceed through the notebooks in the following order:
Step 1: [Explore the algorithm](ExploreAlgorithm.ipynb)
Step 2A: [Launch the local training job](LaunchLocalTrainingJob.ipynb)
Step 3: [Run the model](RunModel.ipynb)
没有合适的资源?快使用搜索试试~ 我知道了~
Airsim自动驾驶汽车,利用keras端到端深度学习自动驾驶汽车,项目面向自动驾驶初学者、研究人员和行业专家
共111个文件
h5:30个
py:17个
ipynb:8个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 79 浏览量
2023-12-08
14:23:48
上传
评论
收藏 155.3MB ZIP 举报
温馨提示
利用keras端到端深度学习自动驾驶汽车,项目面向自动驾驶初学者、研究人员和行业专家。项目以jupter notebook作为载体,使用流行的开源工具(如 Keras , TensorFlow 等)构建,项目提供数据集、源代码、AirSim模拟器,以便于实现自动驾驶快速仿真。
资源推荐
资源详情
资源评论
收起资源包目录
Airsim自动驾驶汽车,利用keras端到端深度学习自动驾驶汽车,项目面向自动驾驶初学者、研究人员和行业专家 (111个子文件)
training_log.csv 3KB
7-ZipFar64.dll 396KB
7za.dll 251KB
7-ZipFar.dll 237KB
7zxa.dll 144KB
7za.exe 676KB
car_driving.gif 6.33MB
car_driving_2.gif 4.67MB
car_driving_3.gif 4.67MB
car_driving_4.gif 4MB
car_driving_1.gif 3.12MB
.gitignore 47B
pretrain_model_weights.h5 5.35MB
model_model.19-0.0004237.h5 5.31MB
model_model.06-0.0013478.h5 5.31MB
model_model.16-0.0020247.h5 5.31MB
model_model.33-0.0003146.h5 5.31MB
model_model.05-0.0023978.h5 5.31MB
model_model.15-0.0048394.h5 5.31MB
model_model.04-0.0039695.h5 5.31MB
model_model.18-0.0005968.h5 5.31MB
model_model.16-0.0003272.h5 5.31MB
model_model.10-0.0004144.h5 5.31MB
model_model.01-0.0220350.h5 5.31MB
model_model.05-0.0220332.h5 5.31MB
model_model.01-0.0219489.h5 5.31MB
model_model.12-0.0219576.h5 5.31MB
model_model.02-0.0204550.h5 5.31MB
model_model.10-0.0220274.h5 5.31MB
model_model.13-0.0212359.h5 5.31MB
model_model.08-0.0005699.h5 5.31MB
model_model.07-0.0220285.h5 5.31MB
model_model.03-0.0101144.h5 5.31MB
model_model.23-0.0003485.h5 5.31MB
model_model.07-0.0010510.h5 5.31MB
model_model.17-0.0011844.h5 5.31MB
model_model.15-0.0003924.h5 5.31MB
model_model.19-0.0003015.h5 5.31MB
model_model.24-0.0003287.h5 5.31MB
model_model.43-0.0002901.h5 5.31MB
model_model.14-0.0152242.h5 5.31MB
model_model.14-0.0004054.h5 5.31MB
7-ZipEng.hlf 2KB
7-ZipRus.hlf 2KB
airsim-autonomous-vehicle.iml 441B
7zToFar.ini 3KB
DataExplorationAndPreparation.ipynb 345KB
TrainModel.ipynb 196KB
ExploreAlgorithm.ipynb 79KB
SetupCluster.ipynb 17KB
TestModel.ipynb 17KB
LaunchTrainingJob.ipynb 9KB
RunModel.ipynb 7KB
LaunchLocalTrainingJob.ipynb 5KB
sample_model.json 37.46MB
notebook_config.json 356B
LICENSE 1KB
7-ZipRus.lng 3KB
7-ZipEng.lng 3KB
README.md 7KB
README.md 6KB
READMECN.md 5KB
CONTRIBUTING.md 4KB
CONTRIBUTINGCN.md 3KB
SECURITY.md 3KB
issue_template.md 990B
issue_templateCN.md 918B
MicrosoftAzureStorageTools.msi 2.7MB
experiment_architecture.png 47KB
CreateImage.ps1 1006B
ProvisionCluster.ps1 408B
distributed_agent.py 30KB
AirSimClient.py 17KB
airsim_client.py 17KB
Generator.py 14KB
rl_model.py 10KB
views.py 9KB
Cooking.py 8KB
TrainModel.py 6KB
TestModel.py 5KB
settings.py 3KB
manage.py 2KB
InstallTestPackages.py 995B
InstallTrainPackages.py 985B
InstallPackages.py 940B
urls.py 925B
wsgi.py 393B
__init__.py 0B
AirSimClient.cpython-35.pyc 21KB
AirSimClient.cpython-36.pyc 19KB
Generator.cpython-35.pyc 9KB
Generator.cpython-36.pyc 8KB
Cooking.cpython-35.pyc 7KB
Cooking.cpython-36.pyc 7KB
Cooking.cpython-39.pyc 7KB
far7z.reg 3KB
run_airsim_on_user_login_xml.template 3KB
setup_machine_py.template 2KB
pool.json.template 1KB
mount_bat.template 129B
共 111 条
- 1
- 2
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 7367
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功