title: How do i save and retrain a neat-python model?
body: <p>I train a neat-python model to play snake. I want to save the model after 50 generations, and after that i want to load it and retrain it from there, is it possible? I saw a method where you can replay it, but just replay it one time, not retraining it from that stage.</p>
  <p>My code for saving:</p>
  <pre><code>winner = p.run(main, 170)
  with open(&quot;winner.pkl&quot;, &quot;wb&quot;) as f:
      pickle.dump(winner, f)
      f.close()
  </code></pre>
  <p>I want to be able to load it and call the run function again to retrain it</p>
  <pre><code>def run(config_file):
  config = neat.config.Config(neat.DefaultGenome, neat.DefaultReproduction,
                              neat.DefaultSpeciesSet, neat.DefaultStagnation,
                              config_file)
  p = neat.Population(config)
  p.add_reporter(neat.StdOutReporter(True))
  stats = neat.StatisticsReporter()
  p.add_reporter(stats)
  winner = p.run(main, 50)
  with open(&quot;winner.pkl&quot;, &quot;wb&quot;) as f:
      pickle.dump(winner, f)
      f.close()
  
  if __name__ == '__main__':
      local_dir = os.path.dirname(__file__)
      config_path = os.path.join(local_dir, 'config-feedforward.txt')
      run(config_path)
  </code></pre>