Open Sarah112358 opened 4 years ago
Hi @Sarah112358, thank you for reporting this. I found the solution is to set bufsize=0
on the call to Popen. See this diff for a fix: https://github.com/maxpumperla/deep_learning_and_the_game_of_go/commit/6afbe8c7ca048c946c2cb512559c9a437b6c24b6
can you teach me how to install Gnugo on windows?
i also want to know how to init gnugo to play with the agnent in the book chapter 8?
@wang869 @xhw98 all I can do is point you to the official documentation, which tells you how to do that: https://www.gnu.org/software/gnugo/gnugo_2.html#SEC13
@Sarah112358 @maxpumperla
for python3.7 smth changed in streams API. To make it work you need to do:
self.gtp_stream = subprocess.Popen( cmd, stdin=pipe, stdout=pipe, bufsize=0 )
stdout.readline()
now returns bytes literal instead of the string, so check line[0] == '=' will never be true. just add .decode() for bytes string like this:
line = self.gtp_stream.stdout.readline().decode()
nice, didn't notice that @macfergus already added diff 👍 BTW I'm on the latest master, it is strange that I still have old code
On windows, self.gtp_stream.stdout.readline() will loop infinitely when an empty line is returned by the bot (e.g. gnugo).