Skip to content

Commit 57513a6

Browse files
fix(zero): error on second set of training eps if model didn't train
- the zero agent requires (batch_size) examples before it will train. the model was trying to save (and getting Adam optimizer weights 0'd)
1 parent d585fc6 commit 57513a6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libraries/mathy_python/mathy/agents/zero/practice_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ def train_with_examples(self, iteration, train_examples, model_path=None):
219219
game = self.get_game()
220220
new_net = self.get_predictor(game)
221221
trainer = SelfPlayTrainer(self.config, new_net, action_size=new_net.predictions)
222-
trainer.train(train_examples, new_net)
223-
new_net.save()
222+
if trainer.train(train_examples, new_net):
223+
new_net.save()
224224

225225

226226
class ParallelPracticeRunner(PracticeRunner):

0 commit comments

Comments
 (0)