Skip to content

Commit

Permalink
Update base_backbone.py
Browse files Browse the repository at this point in the history
Solve the problem:
RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicate
s that your module has parameters that were not used in producing loss. You can enable unused parameter detection by passing the keyword argument `find_unused_parameters=True` to `torch.nn.parallel.DistributedDataParallel`, and by
making sure all `forward` function outputs participate in calculating loss.

reference:
open-mmlab/mmdetection#8208 (comment)
  • Loading branch information
liuchang0523 authored Dec 7, 2023
1 parent 8c4d9dc commit c4248e2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mmyolo/models/backbones/base_backbone.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ def __init__(self,
stage += self.make_stage_plugins(plugins, idx, setting)
self.add_module(f'stage{idx + 1}', nn.Sequential(*stage))
self.layers.append(f'stage{idx + 1}')

self._freeze_stages()

@abstractmethod
def build_stem_layer(self):
Expand Down

0 comments on commit c4248e2

Please sign in to comment.