From 990390258339ec1fd92890235036db56a6ff8acd Mon Sep 17 00:00:00 2001 From: wangxinxin08 <69842442+wangxinxin08@users.noreply.github.com> Date: Sun, 13 Jun 2021 15:51:03 +0800 Subject: [PATCH] fix ema copy problem and correct config of ppyolo in static graph (#3370) --- ppdet/engine/trainer.py | 3 ++- static/configs/ppyolo/ppyolov2_reader.yml | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index 63dbad1b0..afc995fe7 100644 --- a/ppdet/engine/trainer.py +++ b/ppdet/engine/trainer.py @@ -18,6 +18,7 @@ from __future__ import print_function import os import sys +import copy import time import random import datetime @@ -333,7 +334,7 @@ class Trainer(object): # apply ema weight on model if self.use_ema: - weight = self.model.state_dict() + weight = copy.deepcopy(self.model.state_dict()) self.model.set_dict(self.ema.apply()) self._compose_callback.on_epoch_end(self.status) diff --git a/static/configs/ppyolo/ppyolov2_reader.yml b/static/configs/ppyolo/ppyolov2_reader.yml index 02a385c18..d291ab1f7 100644 --- a/static/configs/ppyolo/ppyolov2_reader.yml +++ b/static/configs/ppyolo/ppyolov2_reader.yml @@ -17,7 +17,6 @@ TrainReader: beta: 1.5 - !ColorDistort {} - !RandomExpand - ratio: 2.0 fill_value: [123.675, 116.28, 103.53] - !RandomCrop {} - !RandomFlipImage -- GitLab