microsoft / InnerEye-DeepLearning

Medical Imaging Deep Learning library to train and deploy 3D segmentation models on Azure Machine Learning
https://aka.ms/innereyeoss
MIT License
555 stars 142 forks source link

Issue on running innerEye deep learning with a local dataset instead of Azure blob storage. #816

Closed Med-Rokaimi closed 1 year ago

Med-Rokaimi commented 1 year ago

Is there an existing issue for this?

Problem summary

I'm trying to implement the Sample classification task: Glaucoma Detection on OCT volumes following the steps in the following link: https://innereye-deeplearning.readthedocs.io/md/sample_tasks.html But I want to run the model on a local dataset instead of Azure blob dataset. I created the following file myglaucoma.py:

from InnerEye.ML.configs.classification.GlaucomaPublic import GlaucomaPublic class MyGlaucomaModel(GlaucomaPublic): def init(self) -> None: super().init() self.azure_dataset_id="glaucoma_detection". Where the "glaucoma_detection" is the folder where the dataset is located. When I try to run it using the following command:

python InnerEye/ML/runner.py --model=MyGlaucomaModel

But I get the following error: Unable to make dataset 'glaucoma_detection available for a local run because no AzureML workspace has been provided. Provide a workspace, or set a folder for local execution.

Code for reproduction

class MyGlaucomaModel(GlaucomaPublic):
    def __init__(self) -> None:
        super().__init__()
        self.azure_dataset_id="glaucoma_detection".

Actual outcome

Traceback (most recent call last): File "InnerEye/ML/runner.py", line 467, in main() File "InnerEye/ML/runner.py", line 461, in main run(project_root=fixed_paths.repository_root_directory(), File "InnerEye/ML/runner.py", line 457, in run return runner.run() File "InnerEye/ML/runner.py", line 219, in run azure_run_info = self.submit_to_azureml_if_needed() File "InnerEye/ML/runner.py", line 352, in submit_to_azureml_if_needed azure_run_info = submit_to_azure_if_needed( File "/home/ai/anaconda3/envs/InnerEye/lib/python3.8/site-packages/health_azure/himl.py", line 502, in submit_to_azure_if_needed mounted_input_datasets, mount_contexts = setup_local_datasets(cleaned_input_datasets, File "/home/ai/anaconda3/envs/InnerEye/lib/python3.8/site-packages/health_azure/datasets.py", line 342, in setup_local_datasets target_path, mount_context = d.to_input_dataset_local(workspace) File "/home/ai/anaconda3/envs/InnerEye/lib/python3.8/site-packages/health_azure/datasets.py", line 139, in to_input_dataset_local raise ValueError(f"Unable to make dataset '{self.name} available for a local run because no AzureML " ValueError: Unable to make dataset 'glaucoma_detection available for a local run because no AzureML workspace has been provided. Provide a workspace, or set a folder for local execution.

Error messages

Unable to make dataset 'glaucoma_detection available for a local run because no AzureML workspace has been provided. Provide a workspace, or set a folder for local execution.

Expected outcome

Train the model

System info

No response

AB#7859

Med-Rokaimi commented 1 year ago

Solved local_dataset=full_ml_test_data_path(), self.azure_dataset_id="glaucoma_detection",