TypeError: can't pickle _thread.RLock objects
suixiaodan opened this issue · comments
When I use this command to test Lvis,
./scripts/dist_test.sh ./configs/refinemask/lvis/r50-refinemask-1x.py ../VOS_Model/mmdet/r50-lvis-1x.pth 8 --eval segm`
the following error occurred:
Traceback (most recent call last):
File "/mnt/SSD/RefineMask/tools/test.py", line 152, in <module>
main()
File "/mnt/SSD/RefineMask/tools/test.py", line 137, in main
outputs = multi_gpu_test(model, data_loader, args.tmpdir, args.gpu_collect)
File "/mnt/SSD/RefineMask/mmdet/apis/test.py", line 92, in multi_gpu_test
for i, data in enumerate(data_loader):
File "/home/anaconda3/envs/VOS/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 291, in __iter__
return _MultiProcessingDataLoaderIter(self)
File "/home/anaconda3/envs/VOS/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 737, in __init__
w.start()
File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/process.py", line 105, in start
self._popen = self._Popen(self)
File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/context.py", line 223, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/context.py", line 284, in _Popen
Traceback (most recent call last):
File "/mnt/SSD/RefineMask/tools/test.py", line 152, in <module>
return Popen(process_obj)
File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 32, in __init__
super().__init__(process_obj)
File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/popen_fork.py", line 19, in __init__
self._launch(process_obj)
File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 47, in _launch
reduction.dump(process_obj, fp)
File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/reduction.py", line 60, in dump
main()
ForkingPickler(file, protocol).dump(obj)
File "/mnt/SSD/RefineMask/tools/test.py", line 137, in main
TypeError: can't pickle _thread.RLock objects
Have you ever encountered this problem?
When I use this command to test Lvis,
./scripts/dist_test.sh ./configs/refinemask/lvis/r50-refinemask-1x.py ../VOS_Model/mmdet/r50-lvis-1x.pth 8 --eval segm`
the following error occurred:
Traceback (most recent call last): File "/mnt/SSD/RefineMask/tools/test.py", line 152, in <module> main() File "/mnt/SSD/RefineMask/tools/test.py", line 137, in main outputs = multi_gpu_test(model, data_loader, args.tmpdir, args.gpu_collect) File "/mnt/SSD/RefineMask/mmdet/apis/test.py", line 92, in multi_gpu_test for i, data in enumerate(data_loader): File "/home/anaconda3/envs/VOS/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 291, in __iter__ return _MultiProcessingDataLoaderIter(self) File "/home/anaconda3/envs/VOS/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 737, in __init__ w.start() File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/process.py", line 105, in start self._popen = self._Popen(self) File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/context.py", line 223, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/context.py", line 284, in _Popen Traceback (most recent call last): File "/mnt/SSD/RefineMask/tools/test.py", line 152, in <module> return Popen(process_obj) File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/home/anaconda3/envs/VOS/lib/python3.6/multiprocessing/reduction.py", line 60, in dump main() ForkingPickler(file, protocol).dump(obj) File "/mnt/SSD/RefineMask/tools/test.py", line 137, in main TypeError: can't pickle _thread.RLock objects
Have you ever encountered this problem?
I'm so sorry about this issue. I encountered this recently, and I found it is caused by the 'self.logger' in the LVIS-api.
Just remove the variable 'self.logger' can avoid this problem. I did not encounter this before, so I thought there was something wrong with your environment and did not respond to you.