前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >A3C run torcs

A3C run torcs

作者头像
用户1908973
发布2018-07-24 15:39:39
6660
发布2018-07-24 15:39:39
举报
文章被收录于专栏:CreateAMindCreateAMind

https://github.com/bn2302/rl_torcs

check: https://github.com/bn2302/rl_torcs/issues

we will replace docker use process!

after run ; Come in for an interview

Reinforcement learning with docker and torcs

Installation

The Torcs reinforcement learning environment is based on an Amazon EC2 g2.2xlarge instance running Ubuntu 16.04.

To setup the environment, the following commands have to be executed from a shell:

代码语言:javascript
复制
git clone https://github.com/bn2302/rl_torcs
cd rl_torc/docker/
sudo su
source root_setup.sh
reboot

After rebooting the instance please run the following commands:

代码语言:javascript
复制
cd rl_torc/docker
source user_setup.sh

The script will install the nvidia drivers, nvidia-docker and an xserver, which is used to connect to the agent via virtualgl.

Next to that the script will build the images for two docker containers:

代码语言:javascript
复制
* Torcs running in a container with virtualgl and turbovnc

* A reinforcement learning environment containing Tensorflow, a modified
  vim and other goodies

Start the docker container

The reinforcement learning docker environment is started using start_rl to reattach the environment the alias attach_rl can be used.

Start the training

The different agents can be trained using the scripts in the src folder called train_X.py. Please not if an agent is prematurely canceled the corresponding torcs container must be stopped using docker stop NAME. To list the running containers please use docker ps -l -a

Monitor the training

To monitor the training process, please connect to the containers, go into the logs directory and start tensorboard using

代码语言:javascript
复制
tensorboard --logdir=a3c_0:'./a3c/train_0/',a3c_1:'./a3c/train_1',a3c_2:'./a3c/train_2',a3c_3:'./a3c/train_3',a3c_4:'./a3c/train_4/',a3c_5:'./a3c/train_5',a3c_6:'./a3c/train_6',a3c_7:'./a3c/train_7',ddpg_1:'./ddpg_1',dddpg_ref:'./ddpg_ref',ddpg_2:'./ddpg_2/'

Tensorboard can be accessed via port 6006 from a browser. When connecting to an AWS instance via ssh, forward the port with -L 6006:localhost:6006. Then tensorboard can be opened in a browser using http://localhost:6006/

Start the testing

Testing is done in the Jupyter notebook test.ipynb . To start the jupyter server run the following command from the main directory

代码语言:javascript
复制
jupyter server --allow-root

Jupyter can be accessed via port 8888 from a browser. When connecting to an AWS instance via ssh, forward the port with -L 6006:localhost8888

References

https://github.com/awjuliani/DeepRL-Agents/blob/master/A3C-Doom.ipynb as the basis for the A3c implementation.

https://github.com/yanpanlau/DDPG-Keras-Torcs as the basis for the DDPG.

https://github.com/plumbee/nvidia-hw-accelerated-box as the basis for the setup scripts.

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2017-07-21,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 CreateAMind 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Reinforcement learning with docker and torcs
    • Installation
      • Start the docker container
        • Start the training
          • Monitor the training
            • Start the testing
              • References
              相关产品与服务
              容器服务
              腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
              领券
              问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档