diff --git a/ppcls/engine/evaluation/retrieval.py b/ppcls/engine/evaluation/retrieval.py index f68902285cae9896f76eca30cbabbbacaf5a2b3f..02cae1670bbe1255a84fcf80c3097c5c020c917f 100644 --- a/ppcls/engine/evaluation/retrieval.py +++ b/ppcls/engine/evaluation/retrieval.py @@ -159,7 +159,15 @@ def cal_feature(engine, name='gallery'): if len(batch) == 3: has_unique_id = True batch[2] = batch[2].reshape([-1, 1]).astype("int64") - out = engine.model(batch[0], batch[1]) + if engine.amp and engine.amp_eval: + with paddle.amp.auto_cast( + custom_black_list={ + "flatten_contiguous_range", "greater_than" + }, + level=engine.amp_level): + out = engine.model(batch[0], batch[1]) + else: + out = engine.model(batch[0], batch[1]) if "Student" in out: out = out["Student"] diff --git a/ppcls/optimizer/optimizer.py b/ppcls/optimizer/optimizer.py index be6fa9f70ab8c50422e8f068b8e1c58a3b1c53e9..c0403cf95cdaf442b6fdaeea54d21a2382e3858b 100644 --- a/ppcls/optimizer/optimizer.py +++ b/ppcls/optimizer/optimizer.py @@ -16,9 +16,9 @@ from __future__ import absolute_import from __future__ import division from __future__ import print_function -from paddle import optimizer as optim -import paddle +import inspect +from paddle import optimizer as optim from ppcls.utils import logger @@ -49,21 +49,32 @@ class SGD(object): learning_rate=0.001, weight_decay=None, grad_clip=None, + multi_precision=False, name=None): self.learning_rate = learning_rate self.weight_decay = weight_decay self.grad_clip = grad_clip + self.multi_precision = multi_precision self.name = name def __call__(self, model_list): # model_list is None in static graph parameters = sum([m.parameters() for m in model_list], []) if model_list else None - opt = optim.SGD(learning_rate=self.learning_rate, - parameters=parameters, - weight_decay=self.weight_decay, - grad_clip=self.grad_clip, - name=self.name) + argspec = inspect.getargspec(optim.SGD.__init__).args + if 'multi_precision' in argspec: + opt = optim.SGD(learning_rate=self.learning_rate, + parameters=parameters, + weight_decay=self.weight_decay, + grad_clip=self.grad_clip, + multi_precision=self.multi_precision, + name=self.name) + else: + opt = optim.SGD(learning_rate=self.learning_rate, + parameters=parameters, + weight_decay=self.weight_decay, + grad_clip=self.grad_clip, + name=self.name) return opt @@ -242,8 +253,9 @@ class AdamW(object): if self.one_dim_param_no_weight_decay: self.no_weight_decay_param_name_list += [ - p.name for model in model_list - for n, p in model.named_parameters() if len(p.shape) == 1 + p.name + for model in model_list for n, p in model.named_parameters() + if len(p.shape) == 1 ] if model_list else [] opt = optim.AdamW( diff --git a/test_tipc/config/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 03571154dedcaadc3528aec4d549ad0d281b296b..7fc9ce154d2314e44d078252b0be0a728278bb90 100644 --- a/test_tipc/config/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml +eval:tools/eval.py -c ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 617c5450f605445911f3a4861b3384e5708367d4..e8577b6c56513b1fbf854a33b7e6d5d0b80bc195 100644 --- a/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/MobileNetV3/MobileNetV3_large_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/MobileNetV3/MobileNetV3_large_x1_0.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPHGNet/PPHGNet_small_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPHGNet/PPHGNet_small_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index aa947cf0b22274d5758ebff4b5a68c540fb2a990..af446d3f86b1f0423a656832580d1d617c6db90f 100644 --- a/test_tipc/config/PPHGNet/PPHGNet_small_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPHGNet/PPHGNet_small_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_small.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_small.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_small.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_small.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPHGNet/PPHGNet_tiny_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPHGNet/PPHGNet_tiny_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 9ac54e2fca922469d2ab248b35c3475a5d05a2de..79a945780f722744b05da93ffb6b34e7df89d54e 100644 --- a/test_tipc/config/PPHGNet/PPHGNet_tiny_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPHGNet/PPHGNet_tiny_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_tiny.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_tiny.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_tiny.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPHGNet/PPHGNet_tiny.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_25_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_25_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 6e54a3ba79ccc31c8e6207db5d30c9b4dd4a9644..6943507275a89591e44a7cab9ca9a7a009678489 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_25_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_25_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_25.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_25.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_25.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_25.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_35_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_35_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 2e55b48cad92343e6a41aebfa20c555edd30b9bb..2a9cf14aab08929663cc18c92e76d3710f4a7842 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_35_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_35_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_35.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_35.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_35.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_35.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index efc0297983fca16f3fafe6046782a2effe69925e..028d8517a6f04d006801814b3005a153ba0d9017 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_5.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_5.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x0_75_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x0_75_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 7cea63f0c49a686dc7bb1bf532f16d69cead93c8..d25455dc7e70e22dbb697e030fa9317eb3d05114 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x0_75_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x0_75_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_75.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_75.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_75.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x0_75.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 5dd6ad8c3230047f77a16ec2e1e0a4fce34e75ba..aa03e6bdf417dad772d1f8ea5b7ea015cf09c7b1 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x1_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_0.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_0.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_0.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_0.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x1_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x1_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 344292d1527ff73ad1057400a98198166b76a836..f00b2ac9e2e0172f8465708aae317db8e0429481 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x1_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x1_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_5.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x1_5.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x2_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x2_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index ff2775d125202ac629406e5ad0c9f364586188c2..267d0327c51bf98683e1fadcc8f7a6c9cfc2c940 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x2_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x2_0_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_0.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_0.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_0.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_0.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNet/PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNet/PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 2e0fb555e87efe99d6b05ea99001133518ed0b95..2b1e62676aba4a7b2a03c30cee548b3c50819a65 100644 --- a/test_tipc/config/PPLCNet/PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNet/PPLCNet_x2_5_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_5.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_5.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNet/PPLCNet_x2_5.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 110069ef1b844d5228e6043884c5dcb84e05f523..392d6b906857f70ce1f5071187117e690eccc80d 100644 --- a/test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/PPLCNetV2/PPLCNetV2_base_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNetV2/PPLCNetV2_base.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/PPLCNetV2/PPLCNetV2_base.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/ResNet/ResNet50_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/ResNet/ResNet50_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 177df2dcf3db8b6d7b7967c39ef162a46d6cf6d0..6940a7e0caa8b811e862a6deec5265543adf6764 100644 --- a/test_tipc/config/ResNet/ResNet50_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/ResNet/ResNet50_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/ResNet/ResNet50.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/ResNet/ResNet50.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ to_static_train:-o Global.to_static=True null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/ResNet/ResNet50.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/ResNet/ResNet50.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/ResNet/ResNet50_vd_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/ResNet/ResNet50_vd_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index d5cfdceee1c6d5ba901cef079f776e815096a8eb..d2ea96afe10481182a668d57e77bc1249f035469 100644 --- a/test_tipc/config/ResNet/ResNet50_vd_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/ResNet/ResNet50_vd_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params========================== diff --git a/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt b/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt index 9912a4b5341eacc8762012aad73349e56883415b..8cd92a462c3ab6286a361a3bdb61985037870471 100644 --- a/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt +++ b/test_tipc/config/SwinTransformer/SwinTransformer_tiny_patch4_window7_224_train_linux_gpu_normal_amp_infer_python_linux_gpu_cpu.txt @@ -13,7 +13,7 @@ train_infer_img_dir:./dataset/ILSVRC2012/val null:null ## trainer:amp_train -amp_train:tools/train.py -c ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_tiny_patch4_window7_224.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 +amp_train:tools/train.py -c ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_tiny_patch4_window7_224.yaml -o Global.seed=1234 -o DataLoader.Train.sampler.shuffle=False -o DataLoader.Train.loader.num_workers=0 -o DataLoader.Train.loader.use_shared_memory=False -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 -o Optimizer.multi_precision=True pact_train:null fpgm_train:null distill_train:null @@ -21,7 +21,7 @@ null:null null:null ## ===========================eval_params=========================== -eval:tools/eval.py -c ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_tiny_patch4_window7_224.yaml +eval:tools/eval.py -c ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_tiny_patch4_window7_224.yaml -o AMP.scale_loss=65536 -o AMP.use_dynamic_loss_scaling=True -o AMP.level=O2 null:null ## ===========================infer_params==========================