Browse Source

deal with comments

will-jl944 4 years ago
parent
commit
62a0862f81
2 changed files with 2 additions and 3 deletions
  1. 1 1
      dygraph/paddlex/cv/models/base.py
  2. 1 2
      dygraph/paddlex/cv/models/load_model.py

+ 1 - 1
dygraph/paddlex/cv/models/base.py

@@ -420,7 +420,7 @@ class BaseModel:
                 Otherwise, the pruned model will be saved at save_dir. Defaults to None.
 
         """
-        if self.ne == "Pruned":
+        if self.status == "Pruned":
             raise Exception(
                 "A pruned model cannot be done model pruning again!")
         pre_pruning_flops = flops(self.net, self.pruner.inputs)

+ 1 - 2
dygraph/paddlex/cv/models/load_model.py

@@ -76,8 +76,7 @@ def load_model(model_dir):
                     ratios=model.pruning_ratios,
                     axis=paddleslim.dygraph.prune.filter_pruner.FILTER_DIM)
 
-        if status == 'Quantized' or osp.exists(
-                osp.join(model_dir, "quant.yml")):
+        if status == 'Quantized':
             with open(osp.join(model_dir, "quant.yml")) as f:
                 quant_info = yaml.load(f.read(), Loader=yaml.Loader)
                 quant_config = quant_info['quant_config']