I have used some NEAT algorithms to code my own AI for some easy games like flappy bird. Everything works fine and I know what is going on. The problem is I do not know what to do with the result. The AI learns something and I want to save that progress. TechwithTim YouTuber said something about using pickle, which worked for me when I saved it. I can even load it from the file, but that is where I end. I don't know what to do next to start just one bird to play the game with the knowledge of those birds playing the game before him.
Saving in one code
winner = p.run(game,50)
with open("winner.pkl", "wb") as f:
pickle.dump(winner, f)
f.close()
Opening in another code:
with open("winner.pkl", "wb") as f:
genome = pickle.load(f)
When using
print(type(genome))
output is
<class "neat.genome.DefaultGenome">