diff --git a/slim/distillation/distill.py b/slim/distillation/distill.py index f95fc264e6cf81bcb1c04122731b1e524679437b..dd3a86c0fcab74979baafbcc51becfa927770846 100644 --- a/slim/distillation/distill.py +++ b/slim/distillation/distill.py @@ -305,7 +305,7 @@ def main(): build_strategy=build_strategy, exec_strategy=exec_strategy) - compiled_eval_prog = fluid.compiler.CompiledProgram(eval_prog) + compiled_eval_prog = fluid.CompiledProgram(eval_prog) # whether output bbox is normalized in model output layer is_bbox_normalized = False diff --git a/slim/extensions/distill_pruned_model/distill_pruned_model.py b/slim/extensions/distill_pruned_model/distill_pruned_model.py index 71059202c20901d067e3a7519a7b1fb9a59ca01e..a2adc6cf7652026fb493e7b141e295454bd450e4 100644 --- a/slim/extensions/distill_pruned_model/distill_pruned_model.py +++ b/slim/extensions/distill_pruned_model/distill_pruned_model.py @@ -276,7 +276,7 @@ def main(): loss_name=loss.name, build_strategy=build_strategy, exec_strategy=exec_strategy) - compiled_eval_prog = fluid.compiler.CompiledProgram(eval_prog) + compiled_eval_prog = fluid.CompiledProgram(eval_prog) # parse eval fetches extra_keys = [] diff --git a/slim/nas/train_nas.py b/slim/nas/train_nas.py index f4eca0e31baee8b4cfeb717814ec5c24baf955e9..3c30c7ffdd1c50b2d3c24eb78de14e9e84ed3fa3 100644 --- a/slim/nas/train_nas.py +++ b/slim/nas/train_nas.py @@ -323,7 +323,7 @@ def main(): build_strategy=build_strategy, exec_strategy=exec_strategy) if FLAGS.eval: - compiled_eval_prog = fluid.compiler.CompiledProgram(eval_prog) + compiled_eval_prog = fluid.CompiledProgram(eval_prog) train_loader.set_sample_list_generator(train_reader, place) diff --git a/slim/prune/eval.py b/slim/prune/eval.py index 53f2005b15266f01c21610bd1e82df20fbfa684f..73386d0f7026f8ec8785c57b0917773d28d80e8d 100644 --- a/slim/prune/eval.py +++ b/slim/prune/eval.py @@ -119,8 +119,7 @@ def main(): logger.info("pruned FLOPS: {}".format( float(base_flops - pruned_flops) / base_flops)) - compile_program = fluid.compiler.CompiledProgram( - eval_prog).with_data_parallel() + compile_program = fluid.CompiledProgram(eval_prog).with_data_parallel() assert cfg.metric != 'OID', "eval process of OID dataset \ is not supported." diff --git a/slim/prune/prune.py b/slim/prune/prune.py index f6b219b36b0229c920d48c2e8bde6de8a2fd1682..01b3488d7d80e1090fb5ddc0a3b3bc694eb94918 100644 --- a/slim/prune/prune.py +++ b/slim/prune/prune.py @@ -215,7 +215,7 @@ def main(): logger.info("FLOPs -{}; total FLOPs: {}; pruned FLOPs: {}".format( float(base_flops - pruned_flops) / base_flops, base_flops, pruned_flops)) - compiled_eval_prog = fluid.compiler.CompiledProgram(eval_prog) + compiled_eval_prog = fluid.CompiledProgram(eval_prog) if FLAGS.resume_checkpoint: checkpoint.load_checkpoint(exe, train_prog, FLAGS.resume_checkpoint) diff --git a/slim/quantization/eval.py b/slim/quantization/eval.py index 037bbcfd3f6feb5a2245231aef3f870f95a0d6fd..ecc77e45f85e7b6ef67714fc28c85c604485a182 100644 --- a/slim/quantization/eval.py +++ b/slim/quantization/eval.py @@ -132,8 +132,7 @@ def main(): checkpoint.load_params(exe, eval_prog, cfg.weights) eval_prog = convert(eval_prog, place, config, save_int8=False) - compile_program = fluid.compiler.CompiledProgram( - eval_prog).with_data_parallel() + compile_program = fluid.CompiledProgram(eval_prog).with_data_parallel() results = eval_run(exe, compile_program, loader, keys, values, cls, cfg, sub_eval_prog, sub_keys, sub_values) diff --git a/slim/quantization/train.py b/slim/quantization/train.py index 734dc39d47244b9cde1a63a55e38e9bd7a4c21ea..63c65816b8a337c8f0c169ff260c47427d757b74 100644 --- a/slim/quantization/train.py +++ b/slim/quantization/train.py @@ -200,7 +200,7 @@ def main(): if FLAGS.eval: # insert quantize op in eval_prog eval_prog = quant_aware(eval_prog, place, config, for_test=True) - compiled_eval_prog = fluid.compiler.CompiledProgram(eval_prog) + compiled_eval_prog = fluid.CompiledProgram(eval_prog) start_iter = 0 if FLAGS.resume_checkpoint: diff --git a/slim/sensitive/sensitive.py b/slim/sensitive/sensitive.py index 23581fead69ccacc706f56e80aa8d75f4f6e75c0..4ddea20150623a62f057e4645591ad9050447d27 100644 --- a/slim/sensitive/sensitive.py +++ b/slim/sensitive/sensitive.py @@ -122,7 +122,7 @@ def main(): def test(program): - compiled_eval_prog = fluid.compiler.CompiledProgram(program) + compiled_eval_prog = fluid.CompiledProgram(program) results = eval_run( exe, diff --git a/tools/eval.py b/tools/eval.py index 40840503fda541dadb37e43c7b63d304edcf7938..2c822638f1c9eac0eb8a3118d7e3026af1737670 100644 --- a/tools/eval.py +++ b/tools/eval.py @@ -88,8 +88,7 @@ def main(): cfg.metric, json_directory=FLAGS.output_eval, dataset=dataset) return - compile_program = fluid.compiler.CompiledProgram( - eval_prog).with_data_parallel() + compile_program = fluid.CompiledProgram(eval_prog).with_data_parallel() assert cfg.metric != 'OID', "eval process of OID dataset \ is not supported." diff --git a/tools/train.py b/tools/train.py index 20ae45f0cb9ae4f3be7b85e675b9cfbde1ac6c8d..017fed672236c07b81fa0b95da5ad98fcd89ad4b 100644 --- a/tools/train.py +++ b/tools/train.py @@ -180,7 +180,7 @@ def main(): exec_strategy=exec_strategy) if FLAGS.eval: - compiled_eval_prog = fluid.compiler.CompiledProgram(eval_prog) + compiled_eval_prog = fluid.CompiledProgram(eval_prog) fuse_bn = getattr(model.backbone, 'norm_type', None) == 'affine_channel'