deepgram / kur

Descriptive Deep Learning
Apache License 2.0
814 stars 107 forks source link

Make multiprocessing.pool play nice with SIGINT in speechrec.py #60

Closed joshgev closed 7 years ago

joshgev commented 7 years ago

Currently, the multiprocessing that is used in speechrec.py via a ProcessPoolExecutor doen't work well when a user interrupts Kur during training (using SIGINT). The problem seems to be due to logic used by ProcessPoolExecutor which wraps multiprocessing.Pool.

The solution to the problem is to replace concurrent.futures.ProcessPoolExecutor with multiprocessing.Pool. Some additional logic is added to suppress unnecessary stack traces (those coming from the terminated child processes) from appearing.