From d190db7fcdf6021a69580c2c9ae0fd2ef4eb646b Mon Sep 17 00:00:00 2001 From: Yufeng Li Date: Tue, 20 Jun 2023 09:37:17 -0700 Subject: [PATCH] Update default external_data_location for pre-process of quantization (#16399) external_data_location should be a string/file_name to indicate the file name of external data instead of a directory --- onnxruntime/python/tools/quantization/preprocess.py | 2 +- onnxruntime/python/tools/quantization/shape_inference.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/onnxruntime/python/tools/quantization/preprocess.py b/onnxruntime/python/tools/quantization/preprocess.py index f4caacb5f3..625b49a9af 100644 --- a/onnxruntime/python/tools/quantization/preprocess.py +++ b/onnxruntime/python/tools/quantization/preprocess.py @@ -101,7 +101,7 @@ Essentially this tool performs the following three (skippable) steps: parser.add_argument( "--external_data_location", help="The file location to save the external file", - default="./", + default=None, ) parser.add_argument( "--external_data_size_threshold", diff --git a/onnxruntime/python/tools/quantization/shape_inference.py b/onnxruntime/python/tools/quantization/shape_inference.py index 9aaac95a8d..344009300e 100644 --- a/onnxruntime/python/tools/quantization/shape_inference.py +++ b/onnxruntime/python/tools/quantization/shape_inference.py @@ -32,7 +32,7 @@ def quant_pre_process( verbose: int = 0, save_as_external_data: bool = False, all_tensors_to_one_file: bool = False, - external_data_location: str = "./", + external_data_location: str = None, external_data_size_threshold: int = 1024, ) -> None: """Shape inference and model optimization, in preparation for quantization.