一、安装
1、python2.7
$ sudo apt-get install python2.7
2、tensorflow 0.1
安装0.11cpu版
$ export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.11.0-cp27-none-linux_x86_64.whl
# Python 2
(tensorflow)$ pip install --ignore-installed --upgrade $TF_BINARY_URL
# Python 3
(tensorflow)$ pip3 install --ignore-installed --upgrade $TF_BINARY_URL
3、Keras 1.1.0
sudo pip install keras==1.1.0
4.1 xautomation
$ sudo apt-get install xautomation
4.2 numpy
$ sudo pip3 install numpy
4.3 OpenAI-Gym
git clone https://github.com/openai/gym.git
cd gym
pip3 install -e .
4.4 vtorcs-RL-color
git clone https://github.com/ugo-nama-kun/gym_torcs.git
cd gym_torcs/vtorcs-RL-color/
sudo apt-get install libglib2.0-dev libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev libplib-dev libopenal-dev libalut-dev libxi-dev libxmu-dev libxrender-dev libxrandr-dev libpng-dev
./configure
make(可能会碰见isnan报错,解决方法:在前面添加std::)
make install
make datainstall
至此,安装结束。
二、使用
sudo torcs
python3 snakeoil3_gym.py
说明gym环境安装成功
How to run?
git clone https://github.com/yanpanlau/DDPG-Keras-Torcs.git
cd DDPG-Keras-Torcs
cp *.* ~/gym_torcs
cd ~/gym_torcs
python ddpg.py