@@ -45,7 +45,7 @@ extract all the AWS access tokens from the `curl` commands.
45
45
46
46
Then run the script to download the dataset as follows, providing the path the the file with the curl commands
47
47
and the connection string as commandline arguments, enclosed in quotes:
48
- ` python InnerEye/Scripts/prepare_fastmri.py --curl curl.txt --connection_string "<your_connection_string" ` --location westeurope
48
+ ` python InnerEye/Scripts/prepare_fastmri.py --curl curl.txt --connection_string "<your_connection_string> " ` --location westeurope
49
49
50
50
This script will
51
51
- Authenticate against Azure either using the Service Principal credentials that you set up in Step 3 of the
@@ -83,8 +83,8 @@ If set up correctly, this is the Azure storage account that holds all datasets u
83
83
Hence, after the downloading completes, you are ready to use the InnerEye toolbox to submit an AzureML job that uses
84
84
the FastMRI data.
85
85
86
- There are 3 example models already coded up in the InnerEye toolbox, defined in
87
- [ fastmri_varnet.py] ( ../InnerEye/ML/configs/other/fastmri_varnet.py ) : ` KneeSinglecoil ` , ` KneeMulticoil ` , and
86
+ There are 2 example models already coded up in the InnerEye toolbox, defined in
87
+ [ fastmri_varnet.py] ( ../InnerEye/ML/configs/other/fastmri_varnet.py ) : ` KneeMulticoil ` and
88
88
` BrainMulticoil ` . As with all InnerEye models, you can start a training run by specifying the name of the class
89
89
that defines the model, like this:
90
90
``` shell script
@@ -152,4 +152,46 @@ python InnerEye/ML/runner.py --model BrainMulticoil --azureml=True --use_dataset
152
152
This job should pick up the existing cache file, and output a message like "Copying a pre-computed dataset cache
153
153
file ..."
154
154
155
- The same trick can of course be applied to the other models as well (` KneeSinglecoil ` , ` KneeMulticoil ` ).
155
+ The same trick can of course be applied to other models as well (` KneeMulticoil ` ).
156
+
157
+
158
+ # Running on a GPU machine
159
+
160
+ You can of course run the InnerEye fastMRI models on a reasonably large machine with a GPU for development and
161
+ debugging purposes. Before running, we recommend to download the datasets using a tool
162
+ like [ azcopy] ( http://aka.ms/azcopy ) into a folder, for example the ` datasets ` folder at the repository root.
163
+
164
+ To use ` azcopy ` , you will need the access key to the storage account that holds your data - it's the same storage
165
+ account that was used when creating the Data Factory that downloaded the data.
166
+ - To get that, navigate to the [ Azure Portal] ( https://portal.azure.com ) , and search for the storage account
167
+ that you created to hold your datasets (Step 4 in [ AzureML setup] ( setting_up_aml.md ) ).
168
+ - On the left hand navigation, there is a section "Access Keys". Select that and copy out one of the two keys (_ not_
169
+ the connection strings). The key is a base64 encoded string, it should not contain any special characters apart from
170
+ ` + ` , ` / ` , ` . ` and ` = `
171
+
172
+ Then run this script in the repository root folder:
173
+ ``` shell script
174
+ mkdir datasets
175
+ azcopy --source-key < storage_account_key> --source https://< your_storage_acount> .blob.core.windows.net/datasets/brain_multicoil --destination datasets/brain_multicoil --recursive
176
+ ```
177
+ Replace ` brain_multicoil ` with any of the other datasets names if needed.
178
+
179
+ If you follow these suggested folder structures, there is no further change necessary to the models. You can then
180
+ run, for example, the ` BrainMulticoil ` model by dropping the ` --azureml=True ` flag like this:
181
+ ``` shell script
182
+ python InnerEye/ML/runner.py --model BrainMulticoil
183
+ ```
184
+ The code will recognize that an Azure dataset named ` brain_multicoil ` is already present in the ` datasets ` folder,
185
+ and skip the download.
186
+
187
+ If you choose to download the dataset to a different folder, for example ` /foo/brain_multicoil ` , you will need to
188
+ make a small adjustment to the model in [ fastmri_varnet.py] ( ../InnerEye/ML/configs/other/fastmri_varnet.py ) ,
189
+ and add the ` local_dataset ` argument like this:
190
+ ``` python
191
+ class BrainMulticoil (FastMri ):
192
+ def __init__ (self ) -> None :
193
+ super ().__init__ ()
194
+ self .azure_dataset_id = " brain_multicoil"
195
+ self .local_dataset = Path(" /foo/brain_multicoil" )
196
+ self .dataset_mountpoint = " /tmp/brain_multicoil"
197
+ ```
0 commit comments