From e009c30a7d52b4860dc8721943df5f65d583b3e8 Mon Sep 17 00:00:00 2001 From: "huiguo.wht" Date: Thu, 13 Aug 2020 14:57:59 +0800 Subject: [PATCH] add solution for supporting TensorFlow 2.* --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/README.md b/README.md index e7336ab..0dee66a 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,16 @@ cd DeepLearningFlappyBird python deep_q_network.py ``` +In order to run with TensorFlow 2.*, edit file [deep_q_network.py](./deep_q_network.py) in root directory, replace +```python3 +import tensorflow as tf +``` +by +```python3 +import tensorflow.compat.v1 as tf +tf.disable_v2_behavior() +``` + ## What is Deep Q-Network? It is a convolutional neural network, trained with a variant of Q-learning, whose input is raw pixels and whose output is a value function estimating future rewards.