用Tensorflow训练的AI玩flappy bird小游戏
来源:互联网 发布:长篇小说投稿 知乎 编辑:程序博客网 时间:2024/05/16 16:59
原作者的理论介绍文章:
程序员带你一步步分析AI如何玩Flappy Bird
http://www.jianshu.com/p/0a04426ee3ad
https://www.continuum.io/downloads#linux
cd 下载
sudo chmod +x Anaconda3-4.4.0-Linux-x86_64.sh
./Anaconda3-4.4.0-Linux-x86_64.sh
这个是for python3.6的,因为现在的tensorflow版本是for python 3.5的,改成3.5免得有问题:
conda install python=3.5
cd DeepLearningFlappyBird
python deep_q_network.py
运行报错:
pygame.image.load('assets/sprites/0.png').convert_alpha(),
pygame.error: File is not a Windows BMP file
不知道什么问题,干脆把png全部另存为bmp,在报错的py文件中也做相应修改。
再运行还是报错:找不到sdl_mixer。
不知道什么问题,直接把程序中的mixer相关语句注释掉即可,鸟死的时候你自己“啊”一声吧。
程序员带你一步步分析AI如何玩Flappy Bird
http://www.jianshu.com/p/0a04426ee3ad
1.安装anaconda
下载地址:https://www.continuum.io/downloads#linux
cd 下载
sudo chmod +x Anaconda3-4.4.0-Linux-x86_64.sh
./Anaconda3-4.4.0-Linux-x86_64.sh
这个是for python3.6的,因为现在的tensorflow版本是for python 3.5的,改成3.5免得有问题:
conda install python=3.5
2.安装opencv
conda install --channel https://conda.anaconda.org/menpo opencv33.安装tensorflow
conda install tensorflow4.安装pygame
conda install --channel https://conda.anaconda.org/kne pygame5.安装sdl
conda install --channel https://conda.anaconda.org/ufechner sdl6.运行小鸟游戏
git clone https://github.com/yenchenlin1994/DeepLearningFlappyBird.gitcd DeepLearningFlappyBird
python deep_q_network.py
运行报错:
pygame.image.load('assets/sprites/0.png').convert_alpha(),
pygame.error: File is not a Windows BMP file
不知道什么问题,干脆把png全部另存为bmp,在报错的py文件中也做相应修改。
再运行还是报错:找不到sdl_mixer。
不知道什么问题,直接把程序中的mixer相关语句注释掉即可,鸟死的时候你自己“啊”一声吧。
再运行,就可以看到小鸟自动飞啊飞了:
阅读全文
0 0
- 用Tensorflow训练的AI玩flappy bird小游戏
- Flappy bird 小游戏的实现
- 用Tensorflow基于Deep Q Learning DQN 玩Flappy Bird
- 用Tensorflow基于Deep Q Learning DQN 玩Flappy Bird
- 用DQN玩flappy bird(TensorFlow学习框架)
- 用Tensorflow基于Deep Q Learning DQN 玩Flappy Bird
- 程序员带你一步步分析AI如何玩Flappy Bird
- CRBM 玩flappy bird
- JavaScript 实现flappy bird小游戏
- Unity3d开发小游戏Flappy Bird
- 一个C语言写的小游戏(flappy bird)
- 用Unity3D开发2D小游戏 Flappy Bird
- 为什么 Flappy Bird 这么难,玩的人也这么多?
- 程序员带你一步步分析AI如何玩Flappy Bird
- 用html5实现的flappy-bird
- “反人类”小游戏《Flappy Bird》今天下线
- 基于CC3200的Flappy Bird
- pygame 写的 flappy bird
- 简单使用JTable读取数据库的表
- Rotate List leetcode java
- java中集合工具类Collections的使用
- 集训8.16最小生成树讲解
- 台湾大学林轩田机器学习技法课程学习笔记15 -- Matrix Factorization
- 用Tensorflow训练的AI玩flappy bird小游戏
- poj 1061 青蛙的约会
- jQuery ajax()请求数据工作笔记
- Java简单实现多线程复制文件
- offset家族
- 【MFC学习】菜单资源
- 个人总结php笔试题五
- save could not be completed.Reason:Some characters cannot be mapped using 'ISO-8859-1'character enco
- c++11 for range