2

I use sklearn.grid_search.GridSearchCV in parallel with several cpus/cores. Calling the fit method creates several copies (one for each process) of my data. That causes my processes to crash due to memory limitations.

Is there a way to prevent the function from copying the data for each process? Can I use shared memory for all cores?

2
  • 2
    maybe this answer stackoverflow.com/a/24411581/288875 gives you some hints Commented Oct 2, 2014 at 17:00
  • Thank you. That looks promising. I will try it out. Commented Oct 2, 2014 at 22:45

1 Answer 1

1

python by default creates a new process for each parallel task. This new process copies the data. I would recommend using the multiprocess shared environment to avoid this. You can see an example in https://github.com/alvarouc/polyssifier/blob/master/polyssifier/polyssifier.py#L87

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you for your answer! And thank you for sharing with the community!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.