Skip to content

Commit 94ccb52

Browse files
authored
fix bugs: fixed calib_steps (#42)
Fixed quantized function not being able to modify Calib Steps
1 parent 98553f7 commit 94ccb52

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,14 @@ def load_calibration_dataset(directory: str, input_shape: List[int], batchsize:
7272

7373
def quantize(working_directory: str, setting: QuantizationSetting, model_type: NetworkFramework,
7474
executing_device: str, input_shape: List[int], target_platform: TargetPlatform,
75-
dataloader: DataLoader, calib_steps: int =32) -> BaseGraph:
75+
dataloader: DataLoader, calib_steps: int=32) -> BaseGraph:
7676
if model_type == NetworkFramework.ONNX:
7777
if not os.path.exists(os.path.join(working_directory, 'model.onnx')):
7878
raise FileNotFoundError(f'无法找到你的模型: {os.path.join(working_directory, "model.onnx")},'
7979
'如果你使用caffe的模型,请设置MODEL_TYPE为CAFFE')
8080
return quantize_onnx_model(
8181
onnx_import_file=os.path.join(working_directory, 'model.onnx'),
82-
calib_dataloader=dataloader, calib_steps=32, input_shape=input_shape, setting=setting,
82+
calib_dataloader=dataloader, calib_steps=calib_steps, input_shape=input_shape, setting=setting,
8383
platform=target_platform, device=executing_device, collate_fn=lambda x: x.to(executing_device)
8484
)
8585
if model_type == NetworkFramework.CAFFE:

0 commit comments

Comments
 (0)