Broken Process Pool Error

Why i am getting this issue with this 2 line of code

failed = verify_images(fns)

Please check It and reply

BrokenProcessPool                         Traceback (most recent call last)
Input In [15], in <cell line: 1>()
----> 1 failed = verify_images(fns)
      2 failed

File ~\anaconda3\envs\torch\lib\site-packages\fastai\vision\, in verify_images(fns)
     67 def verify_images(fns):
     68     "Find images in `fns` that can't be opened"
---> 69     return L(fns[i] for i,o in enumerate(parallel(verify_image, fns)) if not o)

File ~\anaconda3\envs\torch\lib\site-packages\fastcore\, in parallel(f, items, n_workers, total, progress, pause, method, threadpool, timeout, chunksize, *args, **kwargs)
    115     if total is None: total = len(items)
    116     r = progress_bar(r, total=total, leave=False)
--> 117 return L(r)

File ~\anaconda3\envs\torch\lib\site-packages\fastcore\, in _L_Meta.__call__(cls, x, *args, **kwargs)
     96 def __call__(cls, x=None, *args, **kwargs):
     97     if not args and not kwargs and x is not None and isinstance(x,cls): return x
---> 98     return super().__call__(x, *args, **kwargs)

File ~\anaconda3\envs\torch\lib\site-packages\fastcore\, in L.__init__(self, items, use_list, match, *rest)
    104 def __init__(self, items=None, *rest, use_list=False, match=None):
    105     if (use_list is not None) or not is_array(items):
--> 106         items = listify(items, *rest, use_list=use_list, match=match)
    107     super().__init__(items)

File ~\anaconda3\envs\torch\lib\site-packages\fastcore\, in listify(o, use_list, match, *rest)
     61 elif isinstance(o, list): res = o
     62 elif isinstance(o, str) or is_array(o): res = [o]
---> 63 elif is_iter(o): res = list(o)
     64 else: res = [o]
     65 if match is not None:

File ~\anaconda3\envs\torch\lib\concurrent\futures\, in _chain_from_iterable_of_lists(iterable)
    478 def _chain_from_iterable_of_lists(iterable):
    479     """
    480     Specialized implementation of itertools.chain.from_iterable.
    481     Each item in *iterable* should be a list.  This function is
    482     careful not to keep references to yielded objects.
    483     """
--> 484     for element in iterable:
    485         element.reverse()
    486         while element:

File ~\anaconda3\envs\torch\lib\concurrent\futures\, in<locals>.result_iterator()
    616 while fs:
    617     # Careful not to keep a reference to the popped future
    618     if timeout is None:
--> 619         yield fs.pop().result()
    620     else:
    621         yield fs.pop().result(end_time - time.monotonic())

File ~\anaconda3\envs\torch\lib\concurrent\futures\, in Future.result(self, timeout)
    442     raise CancelledError()
    443 elif self._state == FINISHED:
--> 444     return self.__get_result()
    445 else:
    446     raise TimeoutError()

File ~\anaconda3\envs\torch\lib\concurrent\futures\, in Future.__get_result(self)
    387 if self._exception:
    388     try:
--> 389         raise self._exception
    390     finally:
    391         # Break a reference cycle with the exception in self._exception
    392         self = None

BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.

:wave: Please share the code blocks above this so that I can assist better. But if you have other notebooks running. Please close them and retry.

1 Like

You don’t mention which platform you are on, nor what research you already did, so does the first item of this search help you?

no it did not helped, i was just doing according to the lecture 2 of course22, with production notebook of the book

More details will help:

  • What OS platform are you on?
  • What version of python are you using?
  • What version of fastai is installed?

Please read How To Ask Questions The Smart Way.

I am using window 11, python 3.8.13 and fastai of ‘2.7.7’

From that link I asked you to read, it seems you missed the part “When you ask your question, display the fact that you have done these things first.”

Can you summarise the other searches you’ve done?

With your additional platform info I suggest this search: “windows” fastai “BrokenProcessPool”
which for me lists: this and this

Or this search: “windows” fastai “BrokenProcessPool” “verify images”
which for me shows a single result.