{"action":"created","issue":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5115","repository_url":"https://api.github.com/repos/scikit-learn/scikit-learn","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5115/labels{/name}","comments_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5115/comments","events_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5115/events","html_url":"https://github.com/scikit-learn/scikit-learn/issues/5115","id":100597083,"number":5115,"title":"GridSearchCV freezes indefinitely with multithreading enabled (i.e. w/ n_jobs != 1)","user":{"login":"eric-czech","id":6130352,"avatar_url":"https://avatars1.githubusercontent.com/u/6130352?v=4","gravatar_id":"","url":"https://api.github.com/users/eric-czech","html_url":"https://github.com/eric-czech","followers_url":"https://api.github.com/users/eric-czech/followers","following_url":"https://api.github.com/users/eric-czech/following{/other_user}","gists_url":"https://api.github.com/users/eric-czech/gists{/gist_id}","starred_url":"https://api.github.com/users/eric-czech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eric-czech/subscriptions","organizations_url":"https://api.github.com/users/eric-czech/orgs","repos_url":"https://api.github.com/users/eric-czech/repos","events_url":"https://api.github.com/users/eric-czech/events{/privacy}","received_events_url":"https://api.github.com/users/eric-czech/received_events","type":"User","site_admin":false},"labels":[{"id":12995755,"url":"https://api.github.com/repos/scikit-learn/scikit-learn/labels/Bug","name":"Bug","color":"e10c02","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/24","html_url":"https://github.com/scikit-learn/scikit-learn/milestone/24","labels_url":"https://api.github.com/repos/scikit-learn/scikit-learn/milestones/24/labels","id":2577444,"number":24,"title":"0.20","description":"","creator":{"login":"jnothman","id":78827,"avatar_url":"https://avatars2.githubusercontent.com/u/78827?v=4","gravatar_id":"","url":"https://api.github.com/users/jnothman","html_url":"https://github.com/jnothman","followers_url":"https://api.github.com/users/jnothman/followers","following_url":"https://api.github.com/users/jnothman/following{/other_user}","gists_url":"https://api.github.com/users/jnothman/gists{/gist_id}","starred_url":"https://api.github.com/users/jnothman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jnothman/subscriptions","organizations_url":"https://api.github.com/users/jnothman/orgs","repos_url":"https://api.github.com/users/jnothman/repos","events_url":"https://api.github.com/users/jnothman/events{/privacy}","received_events_url":"https://api.github.com/users/jnothman/received_events","type":"User","site_admin":false},"open_issues":68,"closed_issues":26,"state":"open","created_at":"2017-06-12T11:07:06Z","updated_at":"2018-04-23T12:58:41Z","due_on":"2018-01-31T08:00:00Z","closed_at":null},"comments":69,"created_at":"2015-08-12T17:47:36Z","updated_at":"2018-05-11T12:55:41Z","closed_at":null,"author_association":"NONE","body":"I've been intermittently running into this issue (in the subject) with GridSearchCV over a year now, across python 2.7, 3.3, and 3.4, two jobs, several different mac osx platforms/laptops, and many different versions of numpy and scikit-learn (I keep them updated pretty well).\n\nI've tried all of these suggestions and none of them **always** work:\n\nhttps://github.com/scikit-learn/scikit-learn/issues/3605 - Setting multiprocessing start method to 'forkserver'\nhttps://github.com/scikit-learn/scikit-learn/issues/2889 - Having issues ONLY when custom scoring functions are passed (I've absolutely had this problem where the same GridSearchCV calls with n_jobs != 1 freeze with a custom scorer but do just fine without one)\nhttps://github.com/joblib/joblib/issues/138 - Setting environment variables from MKL thread counts (I have tried this when running a numpy/sklearn built against mkl from an Anaconda distribution)\nScaling inputs and making sure there are no errors with n_jobs=1 - I'm completely sure that the things I'm trying to do on multiple threads run correctly on one thread, and in a small amount of time\n\nIt's a very frustrating problem that always seems to pop back up right when I'm confident it's gone, and the ONLY workaround that works **100% of the time** for me is going to the source for GridSearchCV in whatever sklearn distribution I'm on an manually changing the backend set in the call to Paralell to 'threading' (instead of multiprocessing).\n\nI haven't benchmarked the difference between that hack and setting n_jobs=1, but would there be any reason to expect any gains with the threading backend over no parallelization at all?  Certainly, it wouldn't be as good as multiprocessing but at least it's more stable.\n\nbtw the most recent versions I've had the same problem on are:\n- Mac OS 10.9.5\n- Python 3.4.3 :: Continuum Analytics, Inc.\n- scikit-learn==0.16.1\n- scipy==0.16.0\n- numpy==1.9.2\n- pandas==0.16.2\n- joblib==0.8.4\n"},"comment":{"url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/comments/388355292","html_url":"https://github.com/scikit-learn/scikit-learn/issues/5115#issuecomment-388355292","issue_url":"https://api.github.com/repos/scikit-learn/scikit-learn/issues/5115","id":388355292,"user":{"login":"avatsaev","id":518974,"avatar_url":"https://avatars2.githubusercontent.com/u/518974?v=4","gravatar_id":"","url":"https://api.github.com/users/avatsaev","html_url":"https://github.com/avatsaev","followers_url":"https://api.github.com/users/avatsaev/followers","following_url":"https://api.github.com/users/avatsaev/following{/other_user}","gists_url":"https://api.github.com/users/avatsaev/gists{/gist_id}","starred_url":"https://api.github.com/users/avatsaev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/avatsaev/subscriptions","organizations_url":"https://api.github.com/users/avatsaev/orgs","repos_url":"https://api.github.com/users/avatsaev/repos","events_url":"https://api.github.com/users/avatsaev/events{/privacy}","received_events_url":"https://api.github.com/users/avatsaev/received_events","type":"User","site_admin":false},"created_at":"2018-05-11T12:55:40Z","updated_at":"2018-05-11T12:55:40Z","author_association":"NONE","body":"Sam problem on Linux Mint (Ubuntu 16.10) Python 3.5\r\n\r\nEverything gets stuck at first Epoch on each core, and CPUs are iddleing, so no work is being done."}}
{"actor":{"display_login":"avatsaev"}}