Skip to content

Windows multithreading doesn't work #178

Description

@TalhaAsmal

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions