5分钟视频系列,一个最简单的无人驾驶 demo。
GITHUB:https://github.com/llSourcell/Self-Driving-Car-Demo
环境准备
sudo apt-get install mercurial
hg clone https://bitbucket.org/pygame/pygame
cd pygame
sudo apt-get install python3-dev python3-numpy libsdl-dev libsdl-image1.2-dev \
libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsmpeg-dev libportmidi-dev \
libavformat-dev libswscale-dev libjpeg-dev libfreetype6-dev
python3 setup.py build
sudo python3 setup.py install
wget https://github.com/viblo/pymunk/archive/pymunk-4.0.0.zip pip install pymunk-4.0.0.zip
pip3 install keras pip3 install git+git://github.com/Theano/Theano.git --upgrade --no-deps pip3 install h5py
到 pymunk 目录 将 python2 的代码格式转为 python3 的
cd /usr/local/lib/python3.5/dist-packages/pymunk 2to3 -w *.py
回到 Self-Driving-Car-Demo 目录
python3 learning.py
报错 pygame.error: No video mode large enough for 1000x700
修改文件 /flat_game/carmunk.py 根据显卡情况修改。1070 的破卡,所以改的小了点。
width = 500 #1000 height = 350 #700
漫长的训练ing ( 根据说明大概需要 36 hour)
25000 轮后报错 /(ㄒoㄒ)/~~
OSError: Unable to create file (unable to open file: name = ‘saved-models/164-150-100-50000-25000.h5’, errn
o = 2, error message = ‘No such file or directory’, flags = 13, o_flags = 242)
创建 saved-models 文件夹。重新训练。。。。
pip3 install matplotlib apt install python3-tk python3 plotting.py
修改 nn.py 中 model 的名字。
python3 playing.py