Traceback (most recent call last):
File "/root/Workspace/project/krrnv5/train.py", line 309, in <module>
mp.spawn(
File "/root/anaconda3/envs/krrn/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 240, in spawn
return start_processes(fn, args, nprocs, join, daemon, start_method='spawn')
File "/root/anaconda3/envs/krrn/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 198, in start_processes
while not context.join():
File "/root/anaconda3/envs/krrn/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 160, in join
raise ProcessRaisedException(msg, error_index, failed_process.pid)
torch.multiprocessing.spawn.ProcessRaisedException:
-- Process 1 terminated with the following error:
Traceback (most recent call last):
File "/root/anaconda3/envs/krrn/lib/python3.9/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/root/Workspace/project/krrnv5/train.py", line 293, in ddp_train
train(rank, copy.deepcopy(opt))
File "/root/Workspace/project/krrnv5/train.py", line 273, in train
trainer.train_epoch(dataloader, epoch, train_logger, opt_pose)
File "/root/Workspace/project/krrnv5/tools/trainer.py", line 71, in train_epoch
for i, patch_datas in enumerate(train_dataloader, 0):
File "/root/anaconda3/envs/krrn/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 435, in __iter__
return self._get_iterator()
File "/root/anaconda3/envs/krrn/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 381, in _get_iterator
return _MultiProcessingDataLoaderIter(self)
File "/root/anaconda3/envs/krrn/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1034, in __init__
w.start()
File "/root/anaconda3/envs/krrn/lib/python3.9/multiprocessing/process.py", line 121, in start
self._popen = self._Popen(self)
File "/root/anaconda3/envs/krrn/lib/python3.9/multiprocessing/context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/root/anaconda3/envs/krrn/lib/python3.9/multiprocessing/context.py", line 284, in _Popen
return Popen(process_obj)
File "/root/anaconda3/envs/krrn/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/root/anaconda3/envs/krrn/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/root/anaconda3/envs/krrn/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/root/anaconda3/envs/krrn/lib/python3.9/multiprocessing/reduction.py", line 60, in dump
ForkingPickler(file, protocol).dump(obj)
AttributeError: Can't pickle local object 'CDLL.__init__.<locals>._FuncPtr'
关于这个问题,我询问了ChatGPT
np.ctypeslib.load_library 分布式训练 AttributeError: Can't pickle local object 'CDLL.__init__.<locals>._FuncPtr'
同学你好,我采用你设计的动态链接库对模型进行在线渲染获取数据,在线渲染在正常的Dataset+Dataloader情况下是可行的,但是当我使用PyTorch提供的分布式训练流程的时候会出现错误:
关于这个问题,我询问了ChatGPT
他的答复是
请问同学有没有好的建议,让这个动态链接库在DDP训练中也可以采用?