Swap the order of ema and to_static
parent
b76c7ec696
commit
018912cab4
|
@ -236,8 +236,6 @@ class Engine(object):
|
|||
|
||||
# build model
|
||||
self.model = build_model(self.config, self.mode)
|
||||
# set @to_static for benchmark, skip this by default.
|
||||
apply_to_static(self.config, self.model, is_rec=self.is_rec)
|
||||
|
||||
# load_pretrain
|
||||
if self.config["Global"]["pretrained_model"] is not None:
|
||||
|
@ -260,6 +258,9 @@ class Engine(object):
|
|||
self.model_ema = ExponentialMovingAverage(
|
||||
self.model, self.config['EMA'].get("decay", 0.9999))
|
||||
|
||||
# set @to_static for benchmark, skip this by default.
|
||||
apply_to_static(self.config, self.model, is_rec=self.is_rec)
|
||||
|
||||
# check the gpu num
|
||||
world_size = dist.get_world_size()
|
||||
self.config["Global"]["distributed"] = world_size != 1
|
||||
|
|
Loading…
Reference in New Issue