Remove unused imports
Catch out of memory errors when training.
Return null when classifier cannot be duplicated per each thread.
Catch more out of memory errors to prevent the GUI from getting stuck.