multiprocess报错:self._value
Closed this issue · 1 comments
`Traceback (most recent call last):
File "/home/wushuaihong/WorkSpace_wsh/miniconda3/envs/invoice_text_render/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "/home/wushuaihong/WorkSpace_wsh/miniconda3/envs/invoice_text_render/lib/python3.6/multiprocessing/pool.py", line 47, in starmapstar
return list(itertools.starmap(args[0], args[1]))
File "main.py", line 80, in generate_img
im, word = gen_img_retry(renderer, img_index)
File "main.py", line 72, in gen_img_retry
raise Exception
Exception
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "main.py", line 166, in
pool.starmap(generate_img, zip(range(start_index, start_index + flags.num_img), repeat(q)))
File "/home/wushuaihong/WorkSpace_wsh/miniconda3/envs/invoice_text_render/lib/python3.6/multiprocessing/pool.py", line 274, in starmap
return self._map_async(func, iterable, starmapstar, chunksize).get()
File "/home/wushuaihong/WorkSpace_wsh/miniconda3/envs/invoice_text_render/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value
Exception`
请问该怎么解决呢。是我的multiprocessing模块版本不对吗。
ubuntu20
python 3.6
修复方式:
把参数中的 strict
改为True
pip install pickle5
把libs/font_utils.py 中的import pickle
改为 import pickle5 as pickle