You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
Trying to train using more than 1 parallel job on Windows results in the following error:
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)
The text was updated successfully, but these errors were encountered: