0

When I try to paralellize python code I get an assertion error. Here is the code :

check = Parallel(n_jobs=ncpu)(delayed(removeident)(h) for h in splitframe)

individually, each element (h) in splitframe works well with the function removeident that is removeident(h) yields expected results.

The error message is on the console :

AssertionError: _ _main_ _
Traceback (most recent call last):
   File "<string>"; line 1, in <module>
   File"C:\Python27\lib\multiprocessing\forking.py"; line 380, in main prepare  (preparation_data)
   File"C:\Python27\lib\multiprocessing\forking.py"; line 488, in prepare assert main_name not in sys.modules, main_name 

What could the problem be?

5
  • What error? Where's the traceback? Commented May 27, 2015 at 13:37
  • I run the code on ipython (jupiter) on the console I get the following error : Commented May 27, 2015 at 13:52
  • I run the code on ipython (jupiter) and on the console I get the following error that prints out repetivtely: AssertionError : _ main _ Commented May 27, 2015 at 14:03
  • Edit the error into the question. Commented May 27, 2015 at 14:11
  • 1
    See Why is it important to protect the main loop when using joblib.Parallel? Commented May 27, 2015 at 14:13

0

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.