You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error happened when running: File "/Users/Sam/Desktop/MSACoures/WorkShop/RL_FlappyBird/Test.py", line 31, in <module> watch() File "/Users/Sam/Desktop/MSACoures/WorkShop/RL_FlappyBird/Test.py", line 19, in watch next_state, reward, done, _ = env.step(action) File "/Users/Sam/Desktop/MSACoures/WorkShop/RL_FlappyBird/Env.py", line 34, in step reward = self.p.act(self.action_set[action]) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 376, in act return sum(self._oneStepAct(action) for i in range(self.frame_skip)) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 376, in <genexpr> return sum(self._oneStepAct(action) for i in range(self.frame_skip)) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 395, in _oneStepAct self._setAction(action) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 411, in _setAction self.game._setAction(action, self.last_action) File "/Users/Sam/PyGame-Learning-Environment/ple/games/base/pygamewrapper.py", line 79, in _setAction pygame.event.post(ku) pygame.error: posted event keycode must be int
And I found the last action may be '[]', error happens here if last_action is None: last_action = self.NOOP
if last_action is None or last_action==[]:` fixed the issue
The text was updated successfully, but these errors were encountered:
MacBook Air --MAC OS 10.14.6
Python3.73 64bit
Wrappered the environment:
`#Code based on https://github.com/KibaAmor/rl-code/blob/master/demos/dqn_flappybird/flappybird_wrapper.py
import numpy as np
from gym import Env, spaces
from ple import PLE
from ple.games import FlappyBird
class FlappyBirdWrapper(Env):
def init(self, **kwargs):
self.game = FlappyBird()
self.p = PLE(self.game, **kwargs)
self.action_set = self.p.getActionSet()
Error happened when running:
File "/Users/Sam/Desktop/MSACoures/WorkShop/RL_FlappyBird/Test.py", line 31, in <module> watch() File "/Users/Sam/Desktop/MSACoures/WorkShop/RL_FlappyBird/Test.py", line 19, in watch next_state, reward, done, _ = env.step(action) File "/Users/Sam/Desktop/MSACoures/WorkShop/RL_FlappyBird/Env.py", line 34, in step reward = self.p.act(self.action_set[action]) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 376, in act return sum(self._oneStepAct(action) for i in range(self.frame_skip)) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 376, in <genexpr> return sum(self._oneStepAct(action) for i in range(self.frame_skip)) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 395, in _oneStepAct self._setAction(action) File "/Users/Sam/PyGame-Learning-Environment/ple/ple.py", line 411, in _setAction self.game._setAction(action, self.last_action) File "/Users/Sam/PyGame-Learning-Environment/ple/games/base/pygamewrapper.py", line 79, in _setAction pygame.event.post(ku) pygame.error: posted event keycode must be int
And I found the last action may be '[]', error happens here
if last_action is None: last_action = self.NOOP
if
last_action is None or last_action==[]:` fixed the issueThe text was updated successfully, but these errors were encountered: