maurock / snake-ga

AI Agent that learns how to play Snake with Deep Q-Learning
531 stars 1k forks source link

Snake body is not visible (speed = 50, display_option = True) #1

Open josdyr opened 5 years ago

josdyr commented 5 years ago

The Snake body is not visible even when setting the speed = 50 and display_option = True as it says in the README. Tried with both Python 3.7.2 and Python 3.6.8.

I know others have had this issue too, from reading the Medium article, comments section.

Python3.6.8/3.7.2 packages: absl-py==0.7.0 astor==0.7.1 cycler==0.10.0 gast==0.2.2 grpcio==1.19.0 h5py==2.9.0 Keras==2.2.4 Keras-Applications==1.0.7 Keras-Preprocessing==1.0.9 kiwisolver==1.0.1 Markdown==3.0.1 matplotlib==3.0.2 mock==2.0.0 numpy==1.16.2 pandas==0.24.1 pbr==5.1.2 protobuf==3.6.1 pygame==1.9.4 pyparsing==2.3.1 python-dateutil==2.8.0 pytz==2018.9 PyYAML==3.13 scipy==1.2.1 seaborn==0.9.0 six==1.12.0 tensorboard==1.13.0 tensorflow==1.13.1 tensorflow-estimator==1.13.0 termcolor==1.1.0 Werkzeug==0.14.1

OS: MacOS Mojave

Tried to go back in the commit log, but seems to be the same issue for me, for all versions.

josdyr commented 5 years ago

Maybe it's a new package-update or something that messes with the plotting/printing of the game.

josdyr commented 5 years ago

Tried on a university (windows) machine this morning and is working fine. Not sure what is going on.

MochiLata commented 5 years ago

This seems to be a OSX specific problem. To fix this problem, in update_screen(), add this line.

def update_screen(): pygame.display.update() pygame.event.get() # <--- Add this line

amelkikh commented 5 years ago

Tried on a university (windows) machine this morning and is working fine. Not sure what is going on.

Please add requirements.txt or env file to the project.

PlasmaIntec commented 5 years ago

This seems to be a MacOS Mojave issue