Skip to content

Commit

Permalink
Merge pull request meituan#801 from triple-Mu/triplemu/fix-upsample
Browse files Browse the repository at this point in the history
Fix Upsample bug in infer..
  • Loading branch information
mtjhl authored Apr 28, 2023
2 parents 041f547 + 7812aa1 commit 62064fc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions yolov6/core/inferer.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ def model_switch(self, model, img_size):
for layer in model.modules():
if isinstance(layer, RepVGGBlock):
layer.switch_to_deploy()
elif isinstance(layer, torch.nn.Upsample) and not hasattr(layer, 'recompute_scale_factor'):
layer.recompute_scale_factor = None # torch 1.11.0 compatibility

LOGGER.info("Switch model to deploy modality.")

Expand Down

0 comments on commit 62064fc

Please sign in to comment.