scikit-learn's GridSearchCV stops working when n_jobs>1

前端 未结 2 1696
渐次进展
渐次进展 2020-12-31 23:54

I have previously asked here come up with following lines of code:

parameters = [{\'weights\': [\'uniform\'], \'n_neighbors\': [5, 10, 20, 30, 40, 50, 60, 70         


        
2条回答
  •  心在旅途
    2021-01-01 00:17

    That worked perfectly for me as well (upgrading was a bit of a drag but this was the only fix, of many attempted, that worked in my case). For any other ipython notebook users out there, the best way to work this in is to add it to the notebook configuration (you'll get an error trying to run it straight in a notebook). The commands can be added like this:

    # in ipython_notebook_config.py
    c.IPKernelApp.exec_lines = ['import multiprocessing', 'multiprocessing.set_start_method("forkserver")']
    

提交回复
热议问题