maxpumperla / deep_learning_and_the_game_of_go

Code and other material for the book "Deep Learning and the Game of Go"
https://www.manning.com/books/deep-learning-and-the-game-of-go
975 stars 387 forks source link

Chapter8:when i running web_mcts.py and play in web,it rasiesd TypeError: 'MCTSAgent' object is not subscriptable #56

Closed xhw98 closed 4 years ago

xhw98 commented 4 years ago

but it runed well in web_random.py lookforward to your reply!

xhw98 commented 4 years ago

Using TensorFlow backend.

maxpumperla commented 4 years ago

hey, you need to pass a dict, not just a name, e.g.

web_app = get_web_app({'random': random_agent})

your error message indicates that you're trying to call get_web_app(agent) for an instance of MCTSAgent. and just to help you help yourself, something not being subscriptable means a Python object doesn't implement __getitem__ like e.g. dict does. once you know that you'll immediately know that you're not passing the right argument to bot_map[bot_name].

Hope this helps!