Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows multithreading doesn't work #178

Open
TalhaAsmal opened this issue Apr 7, 2016 · 0 comments
Open

Windows multithreading doesn't work #178

TalhaAsmal opened this issue Apr 7, 2016 · 0 comments

Comments

@TalhaAsmal
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant