jfzhang95 / pytorch-deeplab-xception

DeepLab v3+ model in PyTorch. Support different backbones.
MIT License
2.89k stars 779 forks source link

TypeError: cannot pickle 'module' object #213

Closed weiqingtangx closed 2 years ago

weiqingtangx commented 2 years ago

Traceback (most recent call last): File "/Users/sunny/Downloads/pytorch-deeplab-xception-master/train.py", line 322, in main() File "/Users/sunny/Downloads/pytorch-deeplab-xception-master/train.py", line 314, in main trainer.training(epoch) File "/Users/sunny/Downloads/pytorch-deeplab-xception-master/train.py", line 107, in training for i, sample in enumerate(tbar): File "/usr/local/lib/python3.9/site-packages/tqdm/std.py", line 1178, in iter for obj in iterable: File "/usr/local/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 359, in iter return self._get_iterator() File "/usr/local/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 305, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/usr/local/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 918, in init w.start() File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in init super().init(process_obj) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_fork.py", line 19, in init self._launch(process_obj) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/usr/local/Cellar/python@3.9/3.9.5/Frameworks/Python.framework/Versions/3.9/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) TypeError: cannot pickle 'module' object

Hi, Could you tell me how to fix this problem?

97andrea97 commented 2 years ago

Did you find the solution?