"git@developer.sourcefind.cn:OpenDAS/fairseq.git" did not exist on "f6a5a54e2442faabde6c67db014061dd34983cde"
Commit 5d7dfaba authored by Matthew Yu's avatar Matthew Yu Committed by Facebook GitHub Bot
Browse files

add basic logging

Summary:
Pull Request resolved: https://github.com/facebookresearch/d2go/pull/422

Add a logger to distillation so we can check when distillation is applied

Reviewed By: XiaoliangDai

Differential Revision: D40375046

fbshipit-source-id: bb1d821fa26fb2da75e82122a30307fcccf7e558
parent 419974bb
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
# We use two additional registries so that users can select their # We use two additional registries so that users can select their
# distillation algorithms in configs: DISILLATION_ALAGORITHM, DISTILLATION_HELPER # distillation algorithms in configs: DISILLATION_ALAGORITHM, DISTILLATION_HELPER
import logging
from abc import abstractmethod from abc import abstractmethod
from dataclasses import dataclass from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Set, Union from typing import Callable, Dict, List, Optional, Set, Union
...@@ -30,6 +31,9 @@ from detectron2.utils.file_io import PathManager ...@@ -30,6 +31,9 @@ from detectron2.utils.file_io import PathManager
from mobile_cv.common.misc.mixin import dynamic_mixin, remove_dynamic_mixin from mobile_cv.common.misc.mixin import dynamic_mixin, remove_dynamic_mixin
logger = logging.getLogger(__name__)
def add_distillation_configs(_C: CN) -> None: def add_distillation_configs(_C: CN) -> None:
"""Add default parameters to config """Add default parameters to config
...@@ -411,6 +415,7 @@ class DistillationModelingHook(mh.ModelingHook): ...@@ -411,6 +415,7 @@ class DistillationModelingHook(mh.ModelingHook):
super().forward(...) # call MyModel.forward super().forward(...) # call MyModel.forward
... ...
""" """
logger.info("Applying distillation")
dynamic_mixin( dynamic_mixin(
model, model,
self.distillation_algorithm_class, self.distillation_algorithm_class,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment