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

Quantization-aware training with NNCF #2099

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
18 changes: 1 addition & 17 deletions src/anomalib/callbacks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@


import logging
from importlib import import_module
from pathlib import Path

import yaml
from jsonargparse import Namespace
from lightning.pytorch.callbacks import Callback
from omegaconf import DictConfig, ListConfig, OmegaConf
from omegaconf import DictConfig, ListConfig

from .checkpoint import ModelCheckpoint
from .graph import GraphLogger
Expand Down Expand Up @@ -48,17 +45,4 @@ def get_callbacks(config: DictConfig | ListConfig | Namespace) -> list[Callback]
load_model = LoadModelCallback(config.ckpt_path)
callbacks.append(load_model)

if "optimization" in config and "nncf" in config.optimization and config.optimization.nncf.apply:
# NNCF wraps torch's jit which conflicts with kornia's jit calls.
# Hence, nncf is imported only when required
nncf_module = import_module("anomalib.utils.callbacks.nncf.callback")
nncf_callback = nncf_module.NNCFCallback
nncf_config = yaml.safe_load(OmegaConf.to_yaml(config.optimization.nncf))
callbacks.append(
nncf_callback(
config=nncf_config,
export_dir=str(Path(config.project.path) / "compressed"),
),
)

return callbacks
4 changes: 0 additions & 4 deletions src/anomalib/callbacks/nncf/__init__.py

This file was deleted.

106 changes: 0 additions & 106 deletions src/anomalib/callbacks/nncf/callback.py

This file was deleted.

243 changes: 0 additions & 243 deletions src/anomalib/callbacks/nncf/utils.py

This file was deleted.

Loading
Loading