forked from openvinotoolkit/nncf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* mlflow logging * something * some changes * Some fixes and clear up * Symbolic link update * Final Updates * Little fixes * Little fixes(one more) * Test mlflow off * Deleted hardcoded log dir * Generalization * Clear up * Fixes * code fixes * Common classification functions carry out * Metrics logging changes
- Loading branch information
Showing
7 changed files
with
104 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import torch.backends.cudnn as cudnn | ||
|
||
from examples.common.sample_config import SampleConfig | ||
from examples.common.execution import ExecutionMode, get_device | ||
from examples.common.distributed import configure_distributed | ||
from examples.common.model_loader import load_resuming_model_state_dict_and_checkpoint_from_path | ||
from nncf.utils import manual_seed | ||
|
||
|
||
def configure_device(current_gpu, config: SampleConfig): | ||
config.current_gpu = current_gpu | ||
config.distributed = config.execution_mode in (ExecutionMode.DISTRIBUTED, ExecutionMode.MULTIPROCESSING_DISTRIBUTED) | ||
if config.distributed: | ||
configure_distributed(config) | ||
|
||
config.device = get_device(config) | ||
|
||
|
||
def set_seed(config): | ||
if config.seed is not None: | ||
manual_seed(config.seed) | ||
cudnn.deterministic = True | ||
cudnn.benchmark = False | ||
|
||
|
||
def load_resuming_checkpoint(resuming_checkpoint_path): | ||
resuming_model_sd = None | ||
resuming_checkpoint = None | ||
if resuming_checkpoint_path is not None: | ||
resuming_model_sd, resuming_checkpoint = load_resuming_model_state_dict_and_checkpoint_from_path( | ||
resuming_checkpoint_path) | ||
return resuming_model_sd, resuming_checkpoint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters