From 662a3909499e7079cafd1a383355d5bd2379d08a Mon Sep 17 00:00:00 2001 From: shippingwang Date: Mon, 6 Jul 2020 18:19:35 +0000 Subject: [PATCH] fix vd --- configs/high_performance/dali_mix.yaml | 45 ++++++++++++++++++++++++++ tools/dali.py | 1 + tools/run_dali.sh | 11 +++++-- 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 configs/high_performance/dali_mix.yaml diff --git a/configs/high_performance/dali_mix.yaml b/configs/high_performance/dali_mix.yaml new file mode 100644 index 00000000..90bdfe62 --- /dev/null +++ b/configs/high_performance/dali_mix.yaml @@ -0,0 +1,45 @@ +mode: 'train' +ARCHITECTURE: + name: 'ResNet50_vd' + +pretrained_model: "" +model_save_dir: "./output/" +classes_num: 1000 +total_images: 1281167 +save_interval: 1 +validate: True +valid_interval: 1 +epochs: 200 +topk: 5 +image_shape: [3, 224, 224] + +use_dali: True +use_mix: True +ls_epsilon: 0.1 + +LEARNING_RATE: + function: 'Cosine' + params: + lr: 0.1 + +OPTIMIZER: + function: 'Momentum' + params: + momentum: 0.9 + regularizer: + function: 'L2' + factor: 0.000070 + +TRAIN: + batch_size: 256 + num_workers: 4 + file_list: "./dataset/ILSVRC2012/train_list.txt" + data_dir: "./dataset/ILSVRC2012/" + shuffle_seed: 0 + +VALID: + batch_size: 64 + num_workers: 4 + file_list: "./dataset/ILSVRC2012/val_list.txt" + data_dir: "./dataset/ILSVRC2012/" + shuffle_seed: 0 diff --git a/tools/dali.py b/tools/dali.py index dd78ca32..48adf4d5 100644 --- a/tools/dali.py +++ b/tools/dali.py @@ -313,6 +313,7 @@ def normalize(feeds, config): def mix(feeds, config, is_train=True): + env = os.environ gpu_num = paddle.fluid.core.get_cuda_device_count() if ( 'PADDLE_TRAINERS_NUM') and ( 'PADDLE_TRAINER_ID' diff --git a/tools/run_dali.sh b/tools/run_dali.sh index 868a48a4..78693ffc 100755 --- a/tools/run_dali.sh +++ b/tools/run_dali.sh @@ -5,8 +5,15 @@ export FLAGS_fraction_of_gpu_memory_to_use=0.8 python3 -m paddle.distributed.launch \ - --selected_gpus="0,1" \ + --selected_gpus="0,1,2,3" \ tools/train.py \ - -c ./configs/high_performance/dali.yaml \ + -c ./configs/high_performance/dali_mix.yaml \ -o use_mix=True \ -o use_dali=True + +#python3 -m paddle.distributed.launch \ +# --selected_gpus="0,1,2,3" \ +# tools/train.py \ +# -c ./configs/high_performance/dali.yaml \ +# -o use_mix=True \ +# -o use_dali=True -- GitLab