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
987 stars 390 forks source link

Error message for listing 7.17 #109

Open alalupo opened 1 year ago

alalupo commented 1 year ago

The method generator.next() in listing 7.17 collapses under Python 3.10 with an error message: AttributeError: 'DataGenerator' object has no attribute 'next' How to transform the code for it to work?

The code: from dlgo.data.parallel_processor import GoDataProcessor

processor = GoDataProcessor() generator = processor.load_go_data('train', 100, use_generator=True) print(generator.get_num_samples()) generator = generator.generate(batch_size=10) X, y = generator.next()