带有进程和错误的多重处理:TypeError:无法腌制_thread.lock对象

时间:2018-08-28 10:29:52

标签: python process multiprocessing pickle

我只是无法解决任何问题,而且我也不明白为什么。我进行多处理,在一个迷你示例中也很好用。但是,当我将其构建为“大”代码时,它将不再起作用。也许有人可以“更轻松”地向我解释该错误,或​​者告诉我我在做错什么?

Blabla Errorlog...
...

File "C:\Users\XXX\eclipse-workspace\ADAScarfs_v1.4\fem\_ModelGenerator.py", line 333, in _generateNodeObj
nodesAdh.start()
File "C:\Anaconda3\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Anaconda3\lib\multiprocessing\context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Anaconda3\lib\multiprocessing\context.py", line 322, in _Popen
return Popen(process_obj)
File "C:\Anaconda3\lib\multiprocessing\popen_spawn_win32.py", line 65, in __init__
reduction.dump(process_obj, to_child)
File "C:\Anaconda3\lib\multiprocessing\reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
TypeError: can't pickle _thread.lock objects
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Anaconda3\lib\multiprocessing\spawn.py", line 105, in spawn_main
exitcode = _main(fd)
File "C:\Anaconda3\lib\multiprocessing\spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
EOFError: Ran out of input

发生错误的代码:

nodesAdh = multiprocessing.Process(target=myScarfMeshR3D.generateAdhesiveNodesObject, args=(_sectionAdh,))
        nodesAdh.start()

0 个答案:

没有答案