From b87a1ea86fa18ce69e44a17ad1b49c1326f19ff9 Mon Sep 17 00:00:00 2001 From: wangxinxin08 <69842442+wangxinxin08@users.noreply.github.com> Date: Sat, 12 Jun 2021 22:45:58 +0800 Subject: [PATCH] fix ema copy problem and correct config of ppyolo in static graph (#3371) --- ppdet/engine/trainer.py | 4 +++- static/configs/ppyolo/ppyolov2_reader.yml | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ppdet/engine/trainer.py b/ppdet/engine/trainer.py index cef560d9d..e0ac8ea16 100644 --- a/ppdet/engine/trainer.py +++ b/ppdet/engine/trainer.py @@ -17,6 +17,8 @@ from __future__ import division from __future__ import print_function import os +import sys +import copy import time import random import datetime @@ -326,7 +328,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