提交 dea8eabb 编写于 作者: R root

fix

上级 4ccfca29
...@@ -46,9 +46,10 @@ TRAIN: ...@@ -46,9 +46,10 @@ TRAIN:
channel_first: False channel_first: False
- RandCropImage: - RandCropImage:
size: 224 size: 224
interpolation: 2
- RandFlipImage: - RandFlipImage:
flip_code: 1 flip_code: 1
- AA: - AutoArgument:
- NormalizeImage: - NormalizeImage:
scale: 1./255. scale: 1./255.
mean: [0.485, 0.456, 0.406] mean: [0.485, 0.456, 0.406]
......
...@@ -172,7 +172,7 @@ class RandFlipImage(object): ...@@ -172,7 +172,7 @@ class RandFlipImage(object):
else: else:
return img return img
class AA(object): class AutoArgument(object):
def __init__(self): def __init__(self):
self.policy = ImageNetPolicy() self.policy = ImageNetPolicy()
......
...@@ -23,6 +23,12 @@ import shutil ...@@ -23,6 +23,12 @@ import shutil
import sys import sys
def main(): def main():
"""
Usage: when training with flag use_ema, and evaluating EMA model, should clean the saved model at first.
To generate clean model:
python ema_clean.py ema_model_dir cleaned_model_dir
"""
cleaned_model_dir = sys.argv[1] cleaned_model_dir = sys.argv[1]
ema_model_dir = sys.argv[2] ema_model_dir = sys.argv[2]
if not os.path.exists(cleaned_model_dir): if not os.path.exists(cleaned_model_dir):
......
...@@ -36,6 +36,8 @@ from ppcls.utils import logger ...@@ -36,6 +36,8 @@ from ppcls.utils import logger
from paddle.fluid.incubate.fleet.collective import fleet from paddle.fluid.incubate.fleet.collective import fleet
from paddle.fluid.incubate.fleet.collective import DistributedStrategy from paddle.fluid.incubate.fleet.collective import DistributedStrategy
import ema
def create_feeds(image_shape, use_mix=None): def create_feeds(image_shape, use_mix=None):
""" """
...@@ -102,7 +104,6 @@ def create_model(architecture, image, classes_num, is_train): ...@@ -102,7 +104,6 @@ def create_model(architecture, image, classes_num, is_train):
name = architecture["name"] name = architecture["name"]
params = architecture.get("params", {}) params = architecture.get("params", {})
params['is_test'] = not is_train params['is_test'] = not is_train
print(params)
model = architectures.__dict__[name](**params) model = architectures.__dict__[name](**params)
out = model.net(input=image, class_dim=classes_num) out = model.net(input=image, class_dim=classes_num)
return out return out
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册