Vegeta2020 / SE-SSD

SE-SSD: Self-Ensembling Single-Stage Object Detector From Point Cloud, CVPR 2021.
Apache License 2.0
811 stars 128 forks source link

TypeError: can't pickle _thread.RLock objects #43

Closed pervaizniazi closed 3 years ago

pervaizniazi commented 3 years ago

Hi,

I am getting following issue while training the model for a single GPU:

Traceback (most recent call last): File "train.py", line 118, in main() File "train.py", line 115, in main train_detector(model, datasets, cfg, distributed=distributed, validate=args.validate, logger=logger,) File "/Code/SE-SSD/det3d/torchie/apis/train_sessd.py", line 301, in train_detector model_ema = copy.deepcopy(model) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File /miniconda3/envs/py36/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 306, in _reconstruct value = deepcopy(value, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 215, in _deepcopy_list append(deepcopy(a, memo)) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/miniconda3/envs/py36/lib/python3.6/copy.py", line 169, in deepcopy rv = reductor(4) TypeError: can't pickle _thread.RLock objects

Any help will be appreciated. Thanks,

FangGet commented 3 years ago

see #14

model_ema = build_detector(cfg.model, train_cfg=cfg.train_cfg, test_cfg=cfg.test_cfg)
for param in model_ema.parameters():
    param.detach_()
pervaizniazi commented 3 years ago

@FangGet

Thank you. It worked !!