[Fix]: fix SWA in pytorch 1.6 (#312)

pull/321/head
RangiLyu 2022-06-21 14:35:22 +08:00 committed by GitHub
parent bc763758d8
commit e470c3aa1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -129,7 +129,7 @@ class StochasticWeightAverage(BaseAveragedModel):
"""
averaged_param.add_(
source_param - averaged_param,
alpha=1 / (steps // self.interval + 1))
alpha=1 / float(steps // self.interval + 1))
@MODELS.register_module()