首先需要安装gym模块,提供游戏的. 1,所需模块 import tensorflow as tf import numpy as np import gym import random from collections import deque from keras.utils.np_utils import to_categorical 2,自定义一个简单的3层Dense Model # 自定义Model class QNetwork(tf.keras.Model): def __init_