Deep Reinforcement Learning for UAV
Semester Project for EE5894 Robot Motion Planning, Fall2018, Virginia Tech
Team Members: Chadha, Abhimanyu, Ragothaman, Shalini and Jianyuan (Jet) Yu
Contact: Abhimanyu([email protected]), Shalini([email protected]), Jet([email protected])
Simulator: AirSim
Open Source Library: CNTK
-
Before start
- make sure good network connection and speed, the whole installation cost more than 20G size download.
- my case:
- Hardware - MacBook Pro (Retina, 13-inch, Early 2015);
- Graphics - Intel Iris Graphics 6100 1536 MB;
- OS - High Sierra Version 10.13.6;
- Xcode - verison 10.0
- install Xcode, and do lanuch to make sure it is well installed.
-
install Epic Games Launcher
-
launch Epic Games Launcher, in left Bar, click "Library", install the Unreal Engine, where I choose the newest version 4.20, the installation take around an hour for the ~20G download .
-
after unreal engine is installed, launch it. Choose "Learn" at left Bar, select the Landscape Mountains scence, which is the official and most widely used one, and it cost ~2G download.
-
When download finished, choose "Create Project" to save it.
-
Build Airsim:
- change path to where you want to install, for my case, I choose
~
. -
git clone https://github.com/Microsoft/AirSim.git cd AirSim ./setup.sh ./build.sh
- the build take me around 20 min
- change path to where you want to install, for my case, I choose
-
Run Blocks, open the
Blocks.uproject
underUnreal/Environments/Blocks/
, it may ask you to rebuild. -
copy the folder
unreal/plugins
ofBlocks
toLandscapeMountains
, in that airsim could run as a plugin in this project. -
Launch the
LandscapeMountains.uproject
.
- install AriSim on Mac in Chinese(https://blog.csdn.net/qq_26919935/article/details/80901773)
- install UE
- signup Unreal Engine
- connect git account
git clone -b 4.17 https://github.com/EpicGames/UnrealEngine.git
- cd UnrealEngine
/Setup.sh
./GenerateProjectFiles.sh
make
- test lanuch by
Engine/Binaries/Linux/UE4Editor
The 5~7 step would eat up ~40G size of disk(while ~8G at Windows) and take ~4h time.
- install Airsim, official guide, Ubuntu start from 1.2.0.
git clone https://github.com/Microsoft/AirSim.git cd AirSim ./setup.sh ./build.sh
- install CNTK
PyPI does NOT support Ubuntu18.04, and wheel (.whl) files way does not support python 3.7.0 so far, if no version fit your computer, try make conda virtual environment. e.g. I make a python2.7 environment to go on.
- fix
libmpi_cxx.so.1
errror -> follow refer,sudo ln -s /usr/lib/x86_64-linux-gnu/libmpi_cxx.so.20 /usr/lib/x86_64-linux-gnu/libmpi_cxx.so.1
andsudo ln -s /usr/lib/x86_64-linux-gnu/libmpi.so.20.10.1 /usr/lib/x86_64-linux-gnu/libmpi.so.12
and update the path asexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu
. - fix
libmklml.so
. -> install byconda install -c anaconda mklml
and update path byexport LD_LIBRARY_PATH=/home/jet/anaconda3/envs/py2/lib:$LD_LIBRARY_PATH
.
- fix
Currently pass import cntk with warning
/home/jet/anaconda3/envs/py2/lib/python2.7/site-packages/cntk/cntk_py_init.py:47: UserWarning: Unsupported Linux distribution (ubuntu-18.04). CNTK supports Ubuntu 16.04 and above, only.
warnings.warn('Unsupported Linux distribution (%s-%s). CNTK supports Ubuntu 16.04 and above, only.' % (__my_distro__, __my_distro_ver__))
However, new problem is DQNcar.py
cannot run through, with bugs MemoryError as
/home/jet/anaconda3/envs/py2/lib/python2.7/site-packages/cntk/cntk_py_init.py:47: UserWarning: Unsupported Linux distribution (ubuntu-18.04). CNTK supports Ubuntu 16.04 and above, only.
warnings.warn('Unsupported Linux distribution (%s-%s). CNTK supports Ubuntu 16.04 and above, only.' % (__my_distro__, __my_distro_ver__))
Connected!
Client Ver:1 (Min Req: 1), Server Ver:1 (Min Req: 1)
Traceback (most recent call last):
File "DQNcar.py", line 505, in <module>
agent = DeepQAgent((NumBufferFrames, SizeRows, SizeCols), NumActions, monitor=True)
File "DQNcar.py", line 270, in __init__
self._memory = ReplayMemory(memory_size, input_shape[1:], 4)
File "DQNcar.py", line 35, in __init__
self._states = np.zeros((size,) + sample_shape, dtype=np.float32)
MemoryError
- test
- test
DQN_car.py
Notice:
- when test
hello_car.py
, make sure you open the UE4Editor and click the PLAY button.
cntk current does not support ubuntu 18.04
- downgrade python to 3.5.0
- install
numpy
,msgpack-rpc-python
- install related
.whl
, e.g. python3.5.0+cntk2.5.0 with (https://cntk.ai/PythonWheel/CPU-Only/cntk-2.5-cp35-cp35m-linux_x86_64.whl) conda install -c anaconda mklml
- update path
export LD_LIBRARY_PATH=/home/jet/anaconda3/lib:$LD_LIBRARY_PATH
, cd to related path to check lib likelibmklml.so
exisit. - type
python
, typeimport cntk
to test. Output would be like
/home/jet/anaconda3/lib/python3.5/site-packages/cntk/cntk_py_init.py:47: UserWarning: Unsupported Linux distribution (ubuntu-18.04). CNTK supports Ubuntu 16.04 and above, only.
warnings.warn('Unsupported Linux distribution (%s-%s). CNTK supports Ubuntu 16.04 and above, only.' % (__my_distro__, __my_distro_ver__))
- Autonomous Driving using End-to-End Deep Learning: an AirSim tutorial - official
- Object Tracing with UAV in AirSim Environment - implement DQN with tensorflow/keras rather than CNTK.
- Obstacle-Avoidance-using-DDQN - CNTK