detectron2
遇到问题:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
Traceback (most recent call last): File "projects/SparseRCNN/train_net.py", line 143, in <module> args=(args,), File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/engine/launch.py", line 62, in launch main_func(*args) File "projects/SparseRCNN/train_net.py", line 131, in main return trainer.train() File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/engine/defaults.py", line 419, in train super().train(self.start_iter, self.max_iter) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/engine/train_loop.py", line 134, in train self.run_step() File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/engine/defaults.py", line 429, in run_step self._trainer.run_step() File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/engine/train_loop.py", line 228, in run_step loss_dict = self.model(data) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/projects/SparseRCNN/sparsercnn/detector.py", line 121, in forward src = self.backbone(images.tensor) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/modeling/backbone/fpn.py", line 127, in forward bottom_up_features = self.bottom_up(x) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/modeling/backbone/resnet.py", line 434, in forward x = self.stem(x) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/modeling/backbone/resnet.py", line 356, in forward x = self.conv1(x) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/ubuntu/bigdisk/part2/SparseR-CNN/detectron2/layers/wrappers.py", line 80, in forward x = self.norm(x) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/nn/modules/module.py", line 722, in _call_impl result = self.forward(*input, **kwargs) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/nn/modules/batchnorm.py", line 493, in forward world_size = torch.distributed.get_world_size(process_group) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/distributed/distributed_c10d.py", line 620, in get_world_size return _get_group_size(group) File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/distributed/distributed_c10d.py", line 219, in _get_group_size _check_default_pg() File "/home/ubuntu/anaconda3/envs/sparse/lib/python3.6/site-packages/torch/distributed/distributed_c10d.py", line 210, in _check_default_pg "Default process group is not initialized" AssertionError: Default process group is not initialized |
解决方法:
vi detectron2/engine/launch.py
修改
if world_size > 1:
为
if world_size >= 1:
本文最后更新于2021年4月7日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!