nshdesai / deepdixit

Guess the prompt from a neural network generated image
2 stars 1 forks source link

Figure out a graceful exit for data generation script #4

Open nshdesai opened 2 years ago

nshdesai commented 2 years ago

It seems as though default signal handling doesn't work out of the box with the data generation script because big-sleep also uses this to gracefully exit during training.

So basically,


for prompt in prompts:
    imagine() # Handles graceful exit
    if terminate:
        exit() # This doesn't work because the top-level signal handler doesn't get called

This means that during each iteration imagine() thinks that the program has been terminated, but this message is not passed on to the script performing the loop.

baronet2 commented 2 years ago

So you're saying there's no way to identify whether imagine() crashed?

nshdesai commented 2 years ago

imagine() can handle its own interrupts (from user), but there's no obvious way to communicate this to the parent function.