diff --git a/CHANGELOG.md b/CHANGELOG.md index 29ada09e8..42dcd578f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ gets uploaded to AzureML, by skipping all test folders. - ([#554](https://github.com/microsoft/InnerEye-DeepLearning/pull/554)) Updated report in CovidModel. Set parameters in the config to run inference on both the validation and test sets by default. - ([#566](https://github.com/microsoft/InnerEye-DeepLearning/pull/566)) Update `hi-ml` dependency to `hi-ml-azure`. +- ([#572](https://github.com/microsoft/InnerEye-DeepLearning/pull/572)) Updated to new version of hi-ml package ### Fixed - ([#537](https://github.com/microsoft/InnerEye-DeepLearning/pull/537)) Print warning if inference is disabled but comparison requested. diff --git a/InnerEye/Azure/azure_runner.py b/InnerEye/Azure/azure_runner.py index 63c7b1ab4..62f7cb8aa 100644 --- a/InnerEye/Azure/azure_runner.py +++ b/InnerEye/Azure/azure_runner.py @@ -18,7 +18,7 @@ from InnerEye.Common.generic_parsing import GenericConfig from InnerEye.ML.common import ModelExecutionMode from InnerEye.ML.utils.config_loader import ModelConfigLoader -from health.azure.datasets import DatasetConfig +from health_azure import DatasetConfig SLEEP_TIME_SECONDS = 30 diff --git a/InnerEye/Azure/azure_util.py b/InnerEye/Azure/azure_util.py index c91c6cc2a..7dc20d534 100644 --- a/InnerEye/Azure/azure_util.py +++ b/InnerEye/Azure/azure_util.py @@ -13,7 +13,7 @@ from InnerEye.Common import fixed_paths from InnerEye.Common.common_util import SUBJECT_METRICS_FILE_NAME -from health.azure.azure_util import create_run_recovery_id +from health_azure.utils import create_run_recovery_id DEFAULT_CROSS_VALIDATION_SPLIT_INDEX = -1 EXPERIMENT_RUN_SEPARATOR = ":" diff --git a/InnerEye/ML/run_ml.py b/InnerEye/ML/run_ml.py index 38dca7724..d0b0cdfe0 100644 --- a/InnerEye/ML/run_ml.py +++ b/InnerEye/ML/run_ml.py @@ -58,9 +58,9 @@ from InnerEye.ML.visualizers import activation_maps from InnerEye.ML.visualizers.plot_cross_validation import \ get_config_and_results_for_offline_runs, plot_cross_validation_from_files -from health.azure.azure_util import ENVIRONMENT_VERSION, create_run_recovery_id, merge_conda_files -from health.azure.datasets import get_or_create_dataset -from health.azure.himl import AzureRunInfo +from health_azure.utils import ENVIRONMENT_VERSION, create_run_recovery_id, merge_conda_files +from health_azure.datasets import get_or_create_dataset +from health_azure import AzureRunInfo ModelDeploymentHookSignature = Callable[[LightningContainer, AzureConfig, Model, ModelProcessing], Any] PostCrossValidationHookSignature = Callable[[ModelConfigBase, Path], None] diff --git a/InnerEye/ML/runner.py b/InnerEye/ML/runner.py index b992a4bf7..036ec1ad9 100755 --- a/InnerEye/ML/runner.py +++ b/InnerEye/ML/runner.py @@ -22,12 +22,13 @@ print(f"Adding InnerEye folder to sys.path: {innereye_root_str}") sys.path.insert(0, innereye_root_str) from InnerEye.Common import fixed_paths + fixed_paths.add_submodules_to_path() from azureml._base_sdk_common import user_agent from azureml.core import Run, ScriptRunConfig -from health.azure.himl import AzureRunInfo, submit_to_azure_if_needed -from health.azure.azure_util import create_run_recovery_id, merge_conda_files, to_azure_friendly_string +from health_azure import AzureRunInfo, submit_to_azure_if_needed +from health_azure.utils import create_run_recovery_id, merge_conda_files, to_azure_friendly_string import matplotlib from InnerEye.Azure.tensorboard_monitor import AMLTensorBoardMonitorConfig, monitor @@ -245,7 +246,6 @@ def submit_to_azureml_if_needed(self) -> AzureRunInfo: all_azure_dataset_ids=self.lightning_container.all_azure_dataset_ids(), all_dataset_mountpoints=self.lightning_container.all_dataset_mountpoints()) - def after_submission_hook(azure_run: Run) -> None: """ A function that will be called right after job submission. diff --git a/InnerEye/Scripts/submit_for_inference.py b/InnerEye/Scripts/submit_for_inference.py index 46df212b4..778568eea 100755 --- a/InnerEye/Scripts/submit_for_inference.py +++ b/InnerEye/Scripts/submit_for_inference.py @@ -19,7 +19,7 @@ DEFAULT_TEST_IMAGE_NAME, DEFAULT_TEST_ZIP_NAME, ENVIRONMENT_YAML_FILE_NAME, PYTHON_ENVIRONMENT_NAME, \ RUN_SCORING_SCRIPT, SCORE_SCRIPT, SETTINGS_YAML_FILE, repository_root_directory from InnerEye.Common.generic_parsing import GenericConfig -from health.azure.himl import create_run_configuration, submit_run +from health_azure import create_run_configuration, submit_run class SubmitForInferenceConfig(GenericConfig): diff --git a/Tests/AfterTraining/test_after_training.py b/Tests/AfterTraining/test_after_training.py index 3ccf96520..5d08b006c 100644 --- a/Tests/AfterTraining/test_after_training.py +++ b/Tests/AfterTraining/test_after_training.py @@ -20,7 +20,7 @@ import pytest from azureml._restclient.constants import RunStatus from azureml.core import Model, Run -from health.azure.himl import RUN_RECOVERY_FILE +from health_azure.himl import RUN_RECOVERY_FILE from InnerEye.Azure.azure_config import AzureConfig from InnerEye.Azure.azure_util import MODEL_ID_KEY_NAME, download_run_output_file, download_run_outputs_by_prefix, \ diff --git a/Tests/Azure/test_azure_util.py b/Tests/Azure/test_azure_util.py index d80f3f041..612da843f 100644 --- a/Tests/Azure/test_azure_util.py +++ b/Tests/Azure/test_azure_util.py @@ -18,7 +18,7 @@ repository_root_directory from Tests.AfterTraining.test_after_training import FALLBACK_ENSEMBLE_RUN, get_most_recent_run, get_most_recent_run_id from Tests.ML.util import get_default_workspace -from health.azure.azure_util import is_run_and_child_runs_completed +from health_azure.utils import is_run_and_child_runs_completed def test_os_path_to_azure_friendly_container_path() -> None: diff --git a/Tests/Common/test_commandline_parsing.py b/Tests/Common/test_commandline_parsing.py index df6779e92..d377143e1 100644 --- a/Tests/Common/test_commandline_parsing.py +++ b/Tests/Common/test_commandline_parsing.py @@ -15,7 +15,7 @@ from InnerEye.ML.deep_learning_config import DeepLearningConfig from InnerEye.ML.runner import Runner from Tests.ML.configs.DummyModel import DummyModel -from health.azure.himl import AzureRunInfo +from health_azure import AzureRunInfo @pytest.mark.parametrize("is_container", [True, False]) @@ -65,7 +65,7 @@ def test_create_ml_runner_args(is_container: bool, azure_run_info = AzureRunInfo(input_datasets=[None], output_datasets=[None], run=None, - is_running_in_azure=False, + is_running_in_azure_ml=False, output_folder=Path.cwd(), logs_folder=Path.cwd()) runner.run_in_situ(azure_run_info) diff --git a/Tests/ML/runners/test_runner.py b/Tests/ML/runners/test_runner.py index 8c77222c3..efa2d4c97 100644 --- a/Tests/ML/runners/test_runner.py +++ b/Tests/ML/runners/test_runner.py @@ -402,7 +402,7 @@ def test_cross_validation_for_lighting_container_models_is_supported() -> None: with mock.patch("sys.argv", [""] + args_list): runner = Runner(project_root=fixed_paths.repository_root_directory(), yaml_config_file=fixed_paths.SETTINGS_YAML_FILE) - with mock.patch("health.azure.himl.submit_run", return_value=mock_run) as create_and_submit_experiment_patch: + with mock.patch("health_azure.himl.submit_run", return_value=mock_run) as create_and_submit_experiment_patch: with pytest.raises(SystemExit): runner.run() assert runner.lightning_container.model_name == 'HelloContainer' diff --git a/Tests/ML/test_download_upload.py b/Tests/ML/test_download_upload.py index c7d6884ce..82d1198c3 100644 --- a/Tests/ML/test_download_upload.py +++ b/Tests/ML/test_download_upload.py @@ -25,7 +25,7 @@ from Tests.ML.configs.DummyModel import DummyModel from Tests.ML.configs.lightning_test_containers import DummyContainerWithDatasets from Tests.ML.util import get_default_azure_config -from health.azure.himl import AzureRunInfo +from health_azure import AzureRunInfo logging_to_stdout(logging.DEBUG) @@ -164,7 +164,7 @@ def _test_mount_for_lightning_container(test_output_dirs: OutputFolderForTests, runner.setup(azure_run_info=AzureRunInfo(input_datasets=path_from_aml, output_datasets=[], run=None, - is_running_in_azure=False, + is_running_in_azure_ml=False, output_folder=Path(), logs_folder=Path() )) diff --git a/Tests/ML/test_lightning_containers.py b/Tests/ML/test_lightning_containers.py index 162ab2920..b584cd458 100644 --- a/Tests/ML/test_lightning_containers.py +++ b/Tests/ML/test_lightning_containers.py @@ -24,7 +24,7 @@ from Tests.ML.configs.lightning_test_containers import (DummyContainerWithAzureDataset, DummyContainerWithHooks, DummyContainerWithModel, DummyContainerWithPlainLightning) from Tests.ML.util import default_runner -from health.azure.himl import AzureRunInfo +from health_azure import AzureRunInfo def test_run_container_in_situ(test_output_dirs: OutputFolderForTests) -> None: diff --git a/environment.yml b/environment.yml index 02fd80a94..92d673d46 100644 --- a/environment.yml +++ b/environment.yml @@ -23,7 +23,7 @@ dependencies: - gitpython==3.1.7 - gputil==1.4.0 - h5py==2.10.0 - - hi-ml-azure>=0.1 + - hi-ml-azure>=0.1.9 - InnerEye-DICOM-RT==1.0.1 - joblib==0.16.0 - jupyter==1.0.0