-
-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 1. tests/_tests_cv_classification_hydra: 'catalyst-dl run --hydra' MNIST classification test pipeline was added 2. catalyst/experiments/hydra_config.py: HydraConfigExperiment was added 3. catalyst/runners/hydra_supervised.py: HydraSupervisedExperiment was added 4. catalyst/dl/script/hydra_run.py: @hydra.main() was added as entry point for hydra configuration experiment 5. catalyst/dl/script/run.py: optional argument '--hydra' was added to change entrypoint to hydra config experiment one 6. catalyst/settings.py: optional 'hydra' package import was added 7. catalyst/utils/hydra_config.py: hydra config utils was added 8. catalyst/utils/hydra_scripts.py: hydra scripts utils was added 9. catalyst/utils/hydra_sys.py: hydra sys utils was added 10. requirements/requirements-hydra.txt: optional 'hydra-core' package was added * Update hydra_supervised.py, __init__.py, and transforms.py * Update hydra_run.py, run.py, and 3 more files... * Update check_dl_cv.sh Hydra cv classification test was fixed * Update config.py, functional.py, and hydra_config.py All dublicated code was replaced to catalyst/experiments/functional.py * Update hydra_supervised.py Hydra cv classification test was fixed * Removed catalyst/utils/hydra_scripts.py, catalyst/utils/hydra_sys.py and changed catalyst/utils/sys.py: Functions 'catalyst/utils/scripts.py:distributed_cmd_run()' and 'catalyst/utils/sys.py:dump_environment()' are used for both HydraConfigExperiment and ConfigExperiment * Renamed catalyst/runners/hydra_supervised.py to catalyst/runners/multi_supervised.py MultiSupervisedRunner was added for multiple model support * Update config_infer.yaml and config_train.yaml due to MultiSupervisedRunner * Updated Dockerfile-dev and Dockerfile-dev-fp16 with installing requirements/requirements-hydra.txt * Update check_dl_cv.sh and run.py for hydra-tests fix * Update config.py and hydra_config.py * catalyst/utils/hydra_config.py: prepare_config() -> prepare_hydra_config() Co-authored-by: Sergey Kolesnikov <[email protected]>
- Loading branch information
1 parent
51428d7
commit 6d453a2
Showing
21 changed files
with
1,452 additions
and
176 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
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,51 @@ | ||
import logging | ||
|
||
import hydra | ||
from omegaconf import DictConfig | ||
|
||
from catalyst.utils.distributed import get_rank | ||
from catalyst.utils.hydra_config import prepare_hydra_config | ||
from catalyst.utils.misc import set_global_seed | ||
from catalyst.utils.scripts import ( | ||
distributed_cmd_run, | ||
dump_code, | ||
import_module, | ||
) | ||
from catalyst.utils.sys import dump_environment | ||
from catalyst.utils.torch import prepare_cudnn | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def main_worker(cfg: DictConfig): | ||
set_global_seed(cfg.args.seed) | ||
prepare_cudnn(cfg.args.deterministic, cfg.args.benchmark) | ||
|
||
import_module(hydra.utils.to_absolute_path(cfg.args.expdir)) | ||
|
||
experiment = hydra.utils.instantiate(cfg.experiment, cfg=cfg) | ||
runner = hydra.utils.instantiate(cfg.runner) | ||
|
||
if experiment.logdir is not None and get_rank() <= 0: | ||
dump_environment(cfg, experiment.logdir) | ||
dump_code( | ||
hydra.utils.to_absolute_path(cfg.args.expdir), experiment.logdir | ||
) | ||
|
||
runner.run_experiment(experiment) | ||
|
||
|
||
@hydra.main() | ||
def main(cfg: DictConfig): | ||
""" | ||
Hydra config catalyst-dl run entry point | ||
Args: | ||
cfg: (DictConfig) configuration | ||
""" | ||
cfg = prepare_hydra_config(cfg) | ||
distributed_cmd_run(main_worker, cfg.args.distributed, cfg) | ||
|
||
|
||
__all__ = ["main"] |
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
Oops, something went wrong.