lucent icon indicating copy to clipboard operation
lucent copied to clipboard

Propagating KeyboardInterrupt in render_vis

Open TomFrederik opened this issue 3 years ago • 0 comments

Currently, when one executes for i in range(num_channels): _ = render.render_vis(model, objective.channels(layer_name, i))

and then interrupts, e.g. by hitting the stop button in Colab, then it will simply stop the current optimization and then continue to loop. This is annoying for interactive programming. I suggest re-raising the KeyboradInterrupt after catching it with the except. This way the code is still stopped when interrupting from keyboard.

TomFrederik avatar Nov 19 '21 11:11 TomFrederik