You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@ipazc
While I was using mtcnn with multiprocessing lib to do parallel inferences,
the code gave an ERROR with opencv-python version 4.2.0.32 and above
Error
File "miniconda3/envs/dbai/lib/python3.7/concurrent/futures/process.py", line 476, in _chain_from_iterable_of_lists
for element in iterable:
File "miniconda3/envs/dbai/lib/python3.7/concurrent/futures/_base.py", line 586, in result_iterator
yield fs.pop().result()
File "miniconda3/envs/dbai/lib/python3.7/concurrent/futures/_base.py", line 425, in result
return self.__get_result()
File "miniconda3/envs/dbai/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
raise self._exception
concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
Implementation
I have tried two ways of multiprocessing on which I received similar error:
with concurrent.futures.ProcessPoolExecutor() as ex:
result = ex.map(extract_face, file_list)
#------------------AND -------------------
p1= multiprocessing.Process(target=extract_face,args=(file_list[0],))
p2= multiprocessing.Process(target=extract_face,args=(file_list[1],))
p1.start()
p2.start()
p1.join()
p2.join()
Solution
Eventually, I was able to figure out the reason, though I am not sure why is this problem occured.
I will be glad if someone could give an explanation for this.
Error occurred due to cv2.resize operation on line:124 in mtcnn.py file Older Code
The text was updated successfully, but these errors were encountered:
torta24x
changed the title
[BUG] Issue while using mtcnn with Multiprocessing lib "multiprocessing" and "concurrent.futures"
Issue while using mtcnn with Multiprocessing lib "multiprocessing" and "concurrent.futures" - cv2.resize() error
Aug 2, 2020
@ipazc
While I was using mtcnn with multiprocessing lib to do parallel inferences,
the code gave an ERROR with opencv-python version 4.2.0.32 and above
Error
Implementation
I have tried two ways of multiprocessing on which I received similar error:
Solution
Eventually, I was able to figure out the reason, though I am not sure why is this problem occured.
I will be glad if someone could give an explanation for this.
Error occurred due to cv2.resize operation on line:124 in mtcnn.py file
Older Code
Modified Code
Is this the correct way to do it, or am I missing something?
Thanks
BONUS
A similar error occurs with mtcnn implementation by PFLD and others (tf and pytorch) implementations on Github
PFLD: https://github.com/guoqiangqi/PFLD.
The text was updated successfully, but these errors were encountered: