Sxela / DiscoDiffusion-Warp

DiscoDiffusion Warp
MIT License
326 stars 42 forks source link

Add nice traceback for exceptions #4

Closed Sxela closed 2 years ago

Sxela commented 2 years ago

Add


torch.cuda.empty_cache()
import traceback
try:
  do_run()
except KeyboardInterrupt:
    pass
except Exception as e:
    print(e)
    print(traceback.format_exc())
finally:
    print('Seed used:', seed)
    gc.collect()
    torch.cuda.empty_cache()```