Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.py #3013

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update main.py
zina-cs authored Oct 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 22b01c082ac8e112fabe090e22cc98babb52919b
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ def prepare_onnx_model(model: YOLO, model_name: str) -> Tuple[onnx.ModelProto, P


def quantize_ac(
model: onnx.ModelProto, data_loader: torch.utils.data.DataLoader, validator_ac: Validator
model: onnx.ModelProto, data_loader: torch.utils.data.DataLoader, validator_ac: Validator, subset_size: int = 128
) -> onnx.ModelProto:
input_name = model.graph.input[0].name

@@ -182,7 +182,7 @@ def validation_ac(
print(f"Validate: dataset length = {counter}, metric value = {stats_metrics:.3f}")
return stats_metrics, None

quantization_dataset = nncf.Dataset(data_loader, transform_fn)
quantization_dataset = nncf.Dataset(data_loader, transform_fn, subset_size=subset_size)

validation_fn = partial(validation_ac, validator=validator_ac)