CodeReclaimers / neat-python

Python implementation of the NEAT neuroevolution algorithm
BSD 3-Clause "New" or "Revised" License
1.4k stars 488 forks source link

Issue a warning instead of silently not writing checkpoints on filename conflict #254

Open asnelling opened 1 year ago

asnelling commented 1 year ago

I'll take a stab at a root-cause and PR after my current project. Apologies if this is a dupe, case of operator-error, or no longer an issue; I'm new to neat-python. :smile:

Is your feature request related to a problem? Please describe.

Sometimes (when?) checkpoints are not created. This is annoying if you only notice this after your machine already spent hours of precious cycles only to run the exact thing again (because you need the checkpoints).

Describe the solution you'd like

Issue a warning if creating a checkpoint fails, ideally right away before the engineer leaves the terminal.

Describe alternatives you've considered

Additional context

My initial suspicion was that neat wasn't creating checkpoints because checkpoint files already existed from a previous run with the same prefix. However, deleting these and running again still produced no checkpoints.

It may be a bug that the checkpoints aren't created, but I'm not familiar with neat yet to determine this. Either way, a warning, possibly with an explanation, that checkpoints will not be created would save some time and wasted CPU cycles.

neat-python==0.92

Checkpoints configured like so:

p.add_reporter(neat.Checkpointer(generation_interval=1,
                                 time_interval_seconds=600,
                                 filename_prefix='neat-checkpoint-'))