From ffb2f9e806bae9991ebbe81dc4cfecc84a5a2e3a Mon Sep 17 00:00:00 2001 From: Szymon Klepacz Date: Sat, 16 Apr 2016 16:12:40 +0200 Subject: [PATCH] Fixed TypeError when retraining The error 'TypeError: Population must be a sequence or set. For dicts, use list(d)' sometimes occurred --- deep_q_network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deep_q_network.py b/deep_q_network.py index 5c969c9..f49d9b1 100755 --- a/deep_q_network.py +++ b/deep_q_network.py @@ -150,7 +150,7 @@ def trainNetwork(s, readout, h_fc1, sess): # only train if done observing if t > OBSERVE: # sample a minibatch to train on - minibatch = random.sample(D, BATCH) + minibatch = random.sample(list(D), BATCH) # get the batch variables s_j_batch = [d[0] for d in minibatch]