Skip to content

Commit

Permalink
Remove warning from examples (#3023)
Browse files Browse the repository at this point in the history
### Changes

Add `subset_size` to PTQ samples after merging
#2995 to remove the warning
message
CI: https://github.com/openvinotoolkit/nncf/actions/runs/11436915496
  • Loading branch information
l-bat authored Oct 21, 2024
1 parent 7c94b23 commit d33ce2f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ def validation_ac(
model,
quantization_dataset,
quantization_dataset,
subset_size=len(data_loader),
validation_fn=validation_fn,
max_drop=0.003,
preset=nncf.QuantizationPreset.MIXED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def transform_fn(data_item):
ov_quantized_model = nncf.quantize_with_accuracy_control(
model=ov_model,
calibration_dataset=calibration_dataset,
subset_size=len(anomaly_images),
validation_dataset=validation_dataset,
validation_fn=validation_fn,
max_drop=max_accuracy_drop,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def transform_fn(data_item: Dict):
quantized_model = nncf.quantize(
model,
quantization_dataset,
subset_size=len(data_loader),
preset=nncf.QuantizationPreset.MIXED,
ignored_scope=nncf.IgnoredScope(
types=["Multiply", "Subtract", "Sigmoid"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def validation_ac(
model,
quantization_dataset,
quantization_dataset,
subset_size=len(data_loader),
validation_fn=validation_fn,
max_drop=0.003,
preset=nncf.QuantizationPreset.MIXED,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def main():

# Quantize model
calibration_dataset = nncf.Dataset(dataset, partial(transform_fn, device=device))
quantized_model = nncf.quantize(model, calibration_dataset)
quantized_model = nncf.quantize(model, calibration_dataset, subset_size=len(dataset))

# Convert to OpenVINO
dummy_input = torch.randn(1, 3, 480, 480)
Expand Down

0 comments on commit d33ce2f

Please sign in to comment.