diff --git a/PaddleSlim/classification/pruning/compress.py b/PaddleSlim/classification/pruning/compress.py index 77f4f83aaf39e2afe7c214d7c558f6992c0218b4..506a5cda1f9267cf0c3921a89327d2ab286f0fd9 100644 --- a/PaddleSlim/classification/pruning/compress.py +++ b/PaddleSlim/classification/pruning/compress.py @@ -88,6 +88,7 @@ def compress(args): exe.run(fluid.default_startup_program()) if args.pretrained_model: + assert os.path.exists(args.pretrained_model), "pretrained_model is not exist!!!" def if_exist(var): return os.path.exists(os.path.join(args.pretrained_model, var.name)) fluid.io.load_vars(exe, args.pretrained_model, predicate=if_exist)