diff --git a/mindspore/nn/acc/acc.py b/mindspore/nn/acc/acc.py index 64f67115bcb..85034f68c2c 100644 --- a/mindspore/nn/acc/acc.py +++ b/mindspore/nn/acc/acc.py @@ -28,7 +28,7 @@ _acc_config_level = { "adasum": False}, "O1": { "less_bn": True, - "grad_freeze": False, + "grad_freeze": True, "adasum": False}, "O2": { "less_bn": True, @@ -53,8 +53,8 @@ class AutoAcc: self._gc_flag = True self._param_groups = 10 self._freeze_type = 1 - self._freeze_p = 0.5 - self._total_steps = -1 + self._freeze_p = 0.7 + self._total_steps = 65536 self._gradient_groups = None self._get_configuration(kwargs) self._param_processer = ParameterProcess() diff --git a/mindspore/nn/acc/grad_freeze.py b/mindspore/nn/acc/grad_freeze.py index a664062c08c..288ce254c5c 100644 --- a/mindspore/nn/acc/grad_freeze.py +++ b/mindspore/nn/acc/grad_freeze.py @@ -59,10 +59,12 @@ class FreezeOpt(Cell): self.opt_class = type(opt.opt) self.opt_init_args = opt.opt.init_args self.lars_init_args = opt.init_args + self.parameters = opt.opt.parameters else: self.is_lars = False self.opt_class = type(opt) self.opt_init_args = opt.init_args + self.parameters = opt.parameters self.opts = [] if train_parameter_groups is None: diff --git a/mindspore/nn/wrap/grad_reducer.py b/mindspore/nn/wrap/grad_reducer.py index db463585027..c41ad0397b7 100644 --- a/mindspore/nn/wrap/grad_reducer.py +++ b/mindspore/nn/wrap/grad_reducer.py @@ -30,14 +30,14 @@ reduce_opt = C.MultitypeFuncGraph("reduce_opt") def _init_allreduce_operators(length, split_indices, group=GlobalComm.WORLD_COMM_GROUP): """ initialize allreduce communication operators""" fusion_type = 2 ** 10 - split = 1 + split = 0 fusion = () for i in range(length): fusion = fusion + (fusion_type,) - if split_indices[split - 1] <= i + 1: - if split >= len(split_indices): - continue - fusion_type += split + if split >= len(split_indices): + continue + if split_indices[split] <= i: + fusion_type += 1 split += 1 index = tuple(range(1, length + 1)) op_list = () diff --git a/model_zoo/official/cv/resnet/config/resnet101_imagenet2012_config.yaml b/model_zoo/official/cv/resnet/config/resnet101_imagenet2012_config.yaml index 3516107b267..9c941604d4a 100644 --- a/model_zoo/official/cv/resnet/config/resnet101_imagenet2012_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet101_imagenet2012_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 32 loss_scale: 1024 momentum: 0.9 @@ -41,6 +42,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet18_cifar10_config.yaml b/model_zoo/official/cv/resnet/config/resnet18_cifar10_config.yaml index d1113625aaa..b2340a4e038 100644 --- a/model_zoo/official/cv/resnet/config/resnet18_cifar10_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet18_cifar10_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 10 +train_image_size: 224 batch_size: 32 loss_scale: 1024 momentum: 0.9 @@ -41,6 +42,7 @@ dataset: "cifar10" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet18_cifar10_config_gpu.yaml b/model_zoo/official/cv/resnet/config/resnet18_cifar10_config_gpu.yaml index 073b380a6f7..c548e8c6252 100644 --- a/model_zoo/official/cv/resnet/config/resnet18_cifar10_config_gpu.yaml +++ b/model_zoo/official/cv/resnet/config/resnet18_cifar10_config_gpu.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 10 +train_image_size: 224 batch_size: 32 loss_scale: 1024 momentum: 0.9 @@ -41,6 +42,7 @@ dataset: "cifar10" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config.yaml b/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config.yaml index d52d7fdf531..f57e2822d5c 100644 --- a/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 256 loss_scale: 1024 momentum: 0.9 @@ -43,6 +44,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config_gpu.yaml b/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config_gpu.yaml index 33232aacbc5..4aedb8bbeee 100644 --- a/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config_gpu.yaml +++ b/model_zoo/official/cv/resnet/config/resnet18_imagenet2012_config_gpu.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 256 loss_scale: 1024 momentum: 0.9 @@ -43,6 +44,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet34_imagenet2012_config.yaml b/model_zoo/official/cv/resnet/config/resnet34_imagenet2012_config.yaml index 8e7d79ff503..7d94fdad15a 100644 --- a/model_zoo/official/cv/resnet/config/resnet34_imagenet2012_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet34_imagenet2012_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 256 loss_scale: 1024 momentum: 0.9 @@ -43,6 +44,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet50_cifar10_config.yaml b/model_zoo/official/cv/resnet/config/resnet50_cifar10_config.yaml index fe0995baa9b..ec164440bfa 100644 --- a/model_zoo/official/cv/resnet/config/resnet50_cifar10_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet50_cifar10_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 10 +train_image_size: 224 batch_size: 32 loss_scale: 1024 momentum: 0.9 @@ -41,6 +42,7 @@ dataset: "cifar10" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Acc_config.yaml b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Acc_config.yaml index 5563840782e..5fe9da7348b 100644 --- a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Acc_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Acc_config.yaml @@ -16,24 +16,25 @@ checkpoint_file_path: "" # ============================================================================== # Training options -optimizer: "Momentum" +optimizer: "LARS" infer_label: "" class_num: 1001 +train_image_size: 192 batch_size: 256 loss_scale: 1024 -momentum: 0.9 -weight_decay: 0.0001 -epoch_size: 90 +momentum: 0.85 +weight_decay: 5.0e-5 +epoch_size: 38 pretrain_epoch_size: 0 -save_checkpoint: True +save_checkpoint: False save_checkpoint_epochs: 5 keep_checkpoint_max: 10 -warmup_epochs: 5 -lr_decay_mode: "cosine" +warmup_epochs: 1 +lr_decay_mode: "poly" use_label_smooth: True label_smooth_factor: 0.1 lr_init: 0 -lr_max: 0.8 +lr_max: 13.96 lr_end: 0.0 lars_epsilon: 0.0 lars_coefficient: 0.001 @@ -43,18 +44,19 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False save_best_ckpt: True -eval_start_epoch: 40 +eval_start_epoch: 1 eval_interval: 1 enable_cache: False cache_session_id: "" mode_name: "GRAPH" acc_mode: "O1" -conv_init: "XavierUniform" -dense_init: "TruncatedNormal" +conv_init: "TruncatedNormal" +dense_init: "RandomNormal" all_reduce_fusion_config: - 85 - 160 diff --git a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Ascend_Thor_config.yaml b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Ascend_Thor_config.yaml index 4ca211328c6..f7e7db312a1 100644 --- a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Ascend_Thor_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_Ascend_Thor_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Thor" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 32 loss_scale: 128 momentum: 0.9 @@ -42,6 +43,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_GPU_Thor_config.yaml b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_GPU_Thor_config.yaml index ceac3f78ae1..c9706ca3216 100644 --- a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_GPU_Thor_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_GPU_Thor_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Thor" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 32 loss_scale: 128 momentum: 0.9 @@ -42,6 +43,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_config.yaml b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_config.yaml index 89938e3b496..40c7e785630 100644 --- a/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_config.yaml +++ b/model_zoo/official/cv/resnet/config/resnet50_imagenet2012_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 256 loss_scale: 1024 momentum: 0.9 @@ -43,6 +44,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 224 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/config/resnet_benchmark_GPU.yaml b/model_zoo/official/cv/resnet/config/resnet_benchmark_GPU.yaml index 9491769f4b8..70a65fffec3 100644 --- a/model_zoo/official/cv/resnet/config/resnet_benchmark_GPU.yaml +++ b/model_zoo/official/cv/resnet/config/resnet_benchmark_GPU.yaml @@ -18,10 +18,12 @@ checkpoint_file_path: '' # Training options optimizer: "Momentum" infer_label: "" +train_image_size: 224 batch_size: 256 epoch_size: 2 print_per_steps: 20 eval: False +eval_image_size: 224 save_ckpt: False mode_name: "GRAPH" dtype: "fp16" diff --git a/model_zoo/official/cv/resnet/config/se-resnet50_imagenet2012_config.yaml b/model_zoo/official/cv/resnet/config/se-resnet50_imagenet2012_config.yaml index 9b59225cb65..7938d0cde61 100644 --- a/model_zoo/official/cv/resnet/config/se-resnet50_imagenet2012_config.yaml +++ b/model_zoo/official/cv/resnet/config/se-resnet50_imagenet2012_config.yaml @@ -19,6 +19,7 @@ checkpoint_file_path: "" optimizer: "Momentum" infer_label: "" class_num: 1001 +train_image_size: 224 batch_size: 32 loss_scale: 1024 momentum: 0.9 @@ -44,6 +45,7 @@ dataset: "imagenet2012" device_num: 1 pre_trained: "" run_eval: False +eval_image_size: 256 eval_dataset_path: "" parameter_server: False filter_weight: False diff --git a/model_zoo/official/cv/resnet/scripts/run_distribute_train.sh b/model_zoo/official/cv/resnet/scripts/run_distribute_train.sh index c5f3903be96..979cb51b878 100755 --- a/model_zoo/official/cv/resnet/scripts/run_distribute_train.sh +++ b/model_zoo/official/cv/resnet/scripts/run_distribute_train.sh @@ -121,8 +121,8 @@ do if [ $# == 5 ] then taskset -c $cmdopt python train.py --run_distribute=True --device_num=$RANK_SIZE --data_path=$PATH2 \ - --run_eval=$RUN_EVAL --eval_data_path=$EVAL_DATASET_PATH --enable_cache=True --cache_session_id=$CACHE_SESSION_ID \ - --config_path=$CONFIG_FILE --output_path './output' &> log & + --run_eval=$RUN_EVAL --eval_dataset_path=$EVAL_DATASET_PATH --enable_cache=True \ + --cache_session_id=$CACHE_SESSION_ID --config_path=$CONFIG_FILE --output_path './output' &> log & if [ "x${RUN_EVAL}" == "xTrue" ] then echo -e "\nWhen training run is done, remember to shut down the cache server via \"cache_admin --stop\"" diff --git a/model_zoo/official/cv/resnet/src/dataset.py b/model_zoo/official/cv/resnet/src/dataset.py index a9a85bd3b98..06f6ed95028 100755 --- a/model_zoo/official/cv/resnet/src/dataset.py +++ b/model_zoo/official/cv/resnet/src/dataset.py @@ -25,8 +25,8 @@ from src.model_utils.config import config from src.model_utils.device_adapter import get_device_num, get_rank_id -def create_dataset1(dataset_path, do_train, repeat_num=1, batch_size=32, target="Ascend", distribute=False, - enable_cache=False, cache_session_id=None): +def create_dataset1(dataset_path, do_train, repeat_num=1, batch_size=32, train_image_size=224, eval_image_size=224, + target="Ascend", distribute=False, enable_cache=False, cache_session_id=None): """ create a train or evaluate cifar10 dataset for resnet50 Args: @@ -67,7 +67,7 @@ def create_dataset1(dataset_path, do_train, repeat_num=1, batch_size=32, target= ] trans += [ - C.Resize((224, 224)), + C.Resize((train_image_size, train_image_size)), C.Rescale(1.0 / 255.0, 0.0), C.Normalize([0.4914, 0.4822, 0.4465], [0.2023, 0.1994, 0.2010]), C.HWC2CHW() @@ -95,8 +95,8 @@ def create_dataset1(dataset_path, do_train, repeat_num=1, batch_size=32, target= return data_set -def create_dataset2(dataset_path, do_train, repeat_num=1, batch_size=32, target="Ascend", distribute=False, - enable_cache=False, cache_session_id=None): +def create_dataset2(dataset_path, do_train, repeat_num=1, batch_size=32, train_image_size=224, eval_image_size=224, + target="Ascend", distribute=False, enable_cache=False, cache_session_id=None): """ create a train or eval imagenet2012 dataset for resnet50 @@ -130,14 +130,13 @@ def create_dataset2(dataset_path, do_train, repeat_num=1, batch_size=32, target= data_set = ds.ImageFolderDataset(dataset_path, num_parallel_workers=12, shuffle=True, num_shards=device_num, shard_id=rank_id) - image_size = 224 mean = [0.485 * 255, 0.456 * 255, 0.406 * 255] std = [0.229 * 255, 0.224 * 255, 0.225 * 255] # define map operations if do_train: trans = [ - C.RandomCropDecodeResize(image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), + C.RandomCropDecodeResize(train_image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), C.RandomHorizontalFlip(prob=0.5), C.Normalize(mean=mean, std=std), C.HWC2CHW() @@ -146,7 +145,7 @@ def create_dataset2(dataset_path, do_train, repeat_num=1, batch_size=32, target= trans = [ C.Decode(), C.Resize(256), - C.CenterCrop(image_size), + C.CenterCrop(eval_image_size), C.Normalize(mean=mean, std=std), C.HWC2CHW() ] @@ -174,8 +173,9 @@ def create_dataset2(dataset_path, do_train, repeat_num=1, batch_size=32, target= return data_set -def create_dataset_pynative(dataset_path, do_train, repeat_num=1, batch_size=32, target="Ascend", distribute=False, - enable_cache=False, cache_session_id=None): +def create_dataset_pynative(dataset_path, do_train, repeat_num=1, batch_size=32, train_image_size=224, + eval_image_size=224, target="Ascend", distribute=False, enable_cache=False, + cache_session_id=None): """ create a train or eval imagenet2012 dataset for resnet50 benchmark @@ -209,14 +209,14 @@ def create_dataset_pynative(dataset_path, do_train, repeat_num=1, batch_size=32, data_set = ds.ImageFolderDataset(dataset_path, num_parallel_workers=2, shuffle=True, num_shards=device_num, shard_id=rank_id) - image_size = 224 + mean = [0.485 * 255, 0.456 * 255, 0.406 * 255] std = [0.229 * 255, 0.224 * 255, 0.225 * 255] # define map operations if do_train: trans = [ - C.RandomCropDecodeResize(image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), + C.RandomCropDecodeResize(train_image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), C.RandomHorizontalFlip(prob=0.5), C.Normalize(mean=mean, std=std), C.HWC2CHW() @@ -225,7 +225,7 @@ def create_dataset_pynative(dataset_path, do_train, repeat_num=1, batch_size=32, trans = [ C.Decode(), C.Resize(256), - C.CenterCrop(image_size), + C.CenterCrop(eval_image_size), C.Normalize(mean=mean, std=std), C.HWC2CHW() ] @@ -253,8 +253,8 @@ def create_dataset_pynative(dataset_path, do_train, repeat_num=1, batch_size=32, return data_set -def create_dataset3(dataset_path, do_train, repeat_num=1, batch_size=32, target="Ascend", distribute=False, - enable_cache=False, cache_session_id=None): +def create_dataset3(dataset_path, do_train, repeat_num=1, batch_size=32, train_image_size=224, eval_image_size=224, + target="Ascend", distribute=False, enable_cache=False, cache_session_id=None): """ create a train or eval imagenet2012 dataset for resnet101 Args: @@ -285,14 +285,14 @@ def create_dataset3(dataset_path, do_train, repeat_num=1, batch_size=32, target= else: data_set = ds.ImageFolderDataset(dataset_path, num_parallel_workers=8, shuffle=True, num_shards=device_num, shard_id=rank_id) - image_size = 224 + mean = [0.475 * 255, 0.451 * 255, 0.392 * 255] std = [0.275 * 255, 0.267 * 255, 0.278 * 255] # define map operations if do_train: trans = [ - C.RandomCropDecodeResize(image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), + C.RandomCropDecodeResize(train_image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), C.RandomHorizontalFlip(rank_id / (rank_id + 1)), C.Normalize(mean=mean, std=std), C.HWC2CHW() @@ -301,7 +301,7 @@ def create_dataset3(dataset_path, do_train, repeat_num=1, batch_size=32, target= trans = [ C.Decode(), C.Resize(256), - C.CenterCrop(image_size), + C.CenterCrop(eval_image_size), C.Normalize(mean=mean, std=std), C.HWC2CHW() ] @@ -329,8 +329,8 @@ def create_dataset3(dataset_path, do_train, repeat_num=1, batch_size=32, target= return data_set -def create_dataset4(dataset_path, do_train, repeat_num=1, batch_size=32, target="Ascend", distribute=False, - enable_cache=False, cache_session_id=None): +def create_dataset4(dataset_path, do_train, repeat_num=1, batch_size=32, train_image_size=224, eval_image_size=224, + target="Ascend", distribute=False, enable_cache=False, cache_session_id=None): """ create a train or eval imagenet2012 dataset for se-resnet50 @@ -362,14 +362,14 @@ def create_dataset4(dataset_path, do_train, repeat_num=1, batch_size=32, target= else: data_set = ds.ImageFolderDataset(dataset_path, num_parallel_workers=12, shuffle=True, num_shards=device_num, shard_id=rank_id) - image_size = 224 + mean = [123.68, 116.78, 103.94] std = [1.0, 1.0, 1.0] # define map operations if do_train: trans = [ - C.RandomCropDecodeResize(image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), + C.RandomCropDecodeResize(train_image_size, scale=(0.08, 1.0), ratio=(0.75, 1.333)), C.RandomHorizontalFlip(prob=0.5), C.Normalize(mean=mean, std=std), C.HWC2CHW() @@ -378,7 +378,7 @@ def create_dataset4(dataset_path, do_train, repeat_num=1, batch_size=32, target= trans = [ C.Decode(), C.Resize(292), - C.CenterCrop(256), + C.CenterCrop(eval_image_size), C.Normalize(mean=mean, std=std), C.HWC2CHW() ] diff --git a/model_zoo/official/cv/resnet/train.py b/model_zoo/official/cv/resnet/train.py index 7048543b7ac..a2c0ad89a7c 100755 --- a/model_zoo/official/cv/resnet/train.py +++ b/model_zoo/official/cv/resnet/train.py @@ -199,7 +199,9 @@ def run_eval(target, model, ckpt_save_dir, cb): if config.eval_dataset_path is None or (not os.path.isdir(config.eval_dataset_path)): raise ValueError("{} is not a existing path.".format(config.eval_dataset_path)) eval_dataset = create_dataset(dataset_path=config.eval_dataset_path, do_train=False, - batch_size=config.batch_size, target=target, enable_cache=config.enable_cache, + batch_size=config.batch_size, train_image_size=config.train_image_size, + eval_image_size=config.eval_image_size, + target=target, enable_cache=config.enable_cache, cache_session_id=config.cache_session_id) eval_param_dict = {"model": model, "dataset": eval_dataset, "metrics_name": "acc"} eval_cb = EvalCallBack(apply_eval, eval_param_dict, interval=config.eval_interval, @@ -226,7 +228,8 @@ def train_net(): target = config.device_target set_parameter() dataset = create_dataset(dataset_path=config.data_path, do_train=True, repeat_num=1, - batch_size=config.batch_size, target=target, + batch_size=config.batch_size, train_image_size=config.train_image_size, + eval_image_size=config.eval_image_size, target=target, distribute=config.run_distribute) step_size = dataset.get_dataset_size() net = resnet(class_num=config.class_num)