diff --git a/configs/high_performance/dali_mix.yaml b/configs/high_performance/dali_mix.yaml new file mode 100644 index 0000000000000000000000000000000000000000..90bdfe623bf4bb7c8d8e0fb2552cc1fd3e7bc880 --- /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 dd78ca32388e05e69771b4d68c6281ea9a1fcab1..48adf4d5ed4d1a38f8032a422366166397dce55f 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 868a48a486140c3830798e2e109db7f174615836..78693ffc8bf92ae76b6c0f6456938c1f1a1bedc8 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