machineJS icon indicating copy to clipboard operation
machineJS copied to clipboard

Windows multithreading doesn't work

Open TalhaAsmal opened this issue 8 years ago • 0 comments

Trying to train using more than 1 parallel job on Windows results in the following error:

ImportError: [joblib] Attempting to do parallel computing without protecting your import on a system that does not support forking. To use parallel-computing in a script, you must protect your main loop using "if __name__ == '__main__'".

This is a known issue on Windows, and from the look of things will require a minor rework to wrap the training code in an "if __name__ == '__main__'"conditional. I'll work on it as I get free time, but if anyone else has a ready and working solution, it would make my life a bit easier.

In the meantime, I've changed RandomizedSearchCV(classifier, parameters_to_try, n_jobs=globalArgs['numCPUs'], error_score=0, n_iter=n_iter, refit=True, cv=cvRounds) to RandomizedSearchCV(classifier, parameters_to_try, n_jobs=1, error_score=0, n_iter=n_iter, refit=True, cv=cvRounds) and searchCV = GridSearchCV(classifier, parameters_to_try, n_jobs=globalArgs['numCPUs'], error_score=0, refit=True, cv=cvRounds) to searchCV = GridSearchCV(classifier, parameters_to_try, n_jobs=1, error_score=0, refit=True, cv=cvRounds)

TalhaAsmal avatar Apr 07 '16 09:04 TalhaAsmal