Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python3 Incompability for frozen_lake.py #76

Closed
kevin00036 opened this issue May 9, 2016 · 1 comment
Closed

Python3 Incompability for frozen_lake.py #76

kevin00036 opened this issue May 9, 2016 · 1 comment

Comments

@kevin00036
Copy link

Running gym with python3.5, task FrozenLake-v0, episodes never terminates even when the agent reaches 'H' or 'G'.

It seems there's some problem with python3 str/bytes.
For example, frozen_lake.py line 71:
isd = np.array(desc == 'S').astype('float64').ravel()
Comparison desc == 'S' will return a big pure python False, rather than a numpy array of booleans. Changing it to desc == b'S' works.
Lines 103, 104, 110, 111 also needs modification:

done = bytes(newletter).decode() in 'GH'
rew = float(newletter == b'G')
@gdb
Copy link
Collaborator

gdb commented May 10, 2016

Good find. Would you be up for opening a pull request?

@gdb gdb closed this as completed in 9d99853 May 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants