when i train the model use your code, something happenyed
sixleaves opened this issue · comments
when i train the model user your code, after 7 minutes, the game speend become very very slowly, i don't whatl's the wrong?
the fps will become 3 fps,i don't know what the happend
i try to train on mac and windows, but it's still appear.on windows i have GPU card, in mac no any one gpu card......。my problem is when i traing, the game’s fps will become only three fps。
my env is:
python 3.6.3
anaconda3
pygame
keras 2.0.8
there are two warning that pycharm give
1)libpng warning: iCCP: known incorrect sRGB profile
2).UserWarning: The default mode, 'constant', will be changed to 'reflect' in skimage 0.15.
I have found when i run into if t > OBSERVE: code 。the game will become slowly。。。
i find the cause.beacuse there will spend much time in below code
`
for i in range(0, len(minibatch)):
state_t = minibatch[i][0]
action_t = minibatch[i][1] #This is action index
reward_t = minibatch[i][2]
state_t1 = minibatch[i][3]
terminal = minibatch[i][4]
inputs[i:i + 1] = state_t #I saved down s_t
targets[i] = model.predict(state_t) # Hitting each buttom probability
Q_sa = model.predict(state_t1)
if terminal:
targets[i, action_t] = reward_t
else:
targets[i, action_t] = reward_t + GAMMA * np.max(Q_sa)`
Code updated and it should run very fast now even on CPU.