diff --git a/fluid/icnet/.run_ce.sh b/fluid/icnet/.run_ce.sh index a46081c7978395697b843c5fef95e6091b47e4e5..643c1ed4cd1bd1012935e063cd8b3e3bbfd4f6d0 100755 --- a/fluid/icnet/.run_ce.sh +++ b/fluid/icnet/.run_ce.sh @@ -2,6 +2,7 @@ # This file is only used for continuous evaluation. +export ce_mode=1 rm -rf *_factor.txt -python train.py --use_gpu=True 1> log +python train.py --use_gpu=True --random_mirror=False --random_scaling=False 1> log cat log | python _ce.py diff --git a/fluid/icnet/_ce.py b/fluid/icnet/_ce.py index 3844eefde620f9587d747594ad0d5351999859c8..af4a4f6b83fe62991571b4c193badb67301d235d 100644 --- a/fluid/icnet/_ce.py +++ b/fluid/icnet/_ce.py @@ -7,7 +7,7 @@ from kpi import CostKpi, DurationKpi, AccKpi # NOTE kpi.py should shared in models in some way!!!! -train_cost_kpi = CostKpi('train_cost', 0.02, actived=True) +train_cost_kpi = CostKpi('train_cost', 0.05, actived=True) train_duration_kpi = DurationKpi('train_duration', 0.06, actived=True) tracking_kpis = [ diff --git a/fluid/icnet/train.py b/fluid/icnet/train.py index b38f08258b9b3e1bd28d808b2779416259f9d827..9b0f4fd4e727baa5986f6dd28dd0dd67b8f07628 100644 --- a/fluid/icnet/train.py +++ b/fluid/icnet/train.py @@ -4,6 +4,7 @@ import cityscape import argparse import functools import sys +import os import time import paddle.fluid as fluid import numpy as np @@ -11,9 +12,8 @@ from utils import add_arguments, print_arguments, get_feeder_data from paddle.fluid.layers.learning_rate_scheduler import _decay_step_counter from paddle.fluid.initializer import init_on_cpu -SEED = 90 -# random seed must set before configuring the network. -fluid.default_startup_program().random_seed = SEED +if 'ce_mode' in os.environ: + np.random.seed(10) parser = argparse.ArgumentParser(description=__doc__) add_arg = functools.partial(add_arguments, argparser=parser) @@ -87,6 +87,10 @@ def train(args): if args.use_gpu: place = fluid.CUDAPlace(0) exe = fluid.Executor(place) + + if 'ce_mode' in os.environ: + fluid.default_startup_program().random_seed = 90 + exe.run(fluid.default_startup_program()) if args.init_model is not None: