Updated curated environments in sample notebooks (#1958)

* Updated curated environments in sample notebooks

* Fixed continuous retraining notebook
This commit is contained in:
jeff-shepherd
2024-02-15 10:01:44 -08:00
committed by GitHub
parent 33ca8c7933
commit f0442166cd
6 changed files with 1546 additions and 1548 deletions

View File

@@ -36,7 +36,10 @@ except Exception:
last_train_time = datetime.min.replace(tzinfo=pytz.UTC)
train_ds = Dataset.get_by_name(ws, args.ds_name)
dataset_changed_time = train_ds.data_changed_time
dataset_changed_time = train_ds.data_changed_time.replace(tzinfo=pytz.UTC)
print("dataset_changed_time=" + str(dataset_changed_time))
print("last_train_time=" + str(last_train_time))
if not dataset_changed_time > last_train_time:
print("Cancelling run since there is no new data.")

View File

@@ -94,15 +94,15 @@ def main():
os.makedirs(output_dir, exist_ok=True)
kwargs = {'num_workers': 1, 'pin_memory': True} if use_cuda else {}
# Use Azure Open Datasets for MNIST dataset
# MNIST dataset
datasets.MNIST.resources = [
("https://azureopendatastorage.azurefd.net/mnist/train-images-idx3-ubyte.gz",
("train-images-idx3-ubyte.gz",
"f68b3c2dcbeaaa9fbdd348bbdeb94873"),
("https://azureopendatastorage.azurefd.net/mnist/train-labels-idx1-ubyte.gz",
("train-labels-idx1-ubyte.gz",
"d53e105ee54ea40749a09fcbcd1e9432"),
("https://azureopendatastorage.azurefd.net/mnist/t10k-images-idx3-ubyte.gz",
("t10k-images-idx3-ubyte.gz",
"9fb629c4189551a2d022fa330f9573f3"),
("https://azureopendatastorage.azurefd.net/mnist/t10k-labels-idx1-ubyte.gz",
("t10k-labels-idx1-ubyte.gz",
"ec29112dd5afa0611ce80d1b7f02629c")
]
train_loader = torch.utils.data.DataLoader(

View File

@@ -200,18 +200,14 @@
"metadata": {},
"outputs": [],
"source": [
"from azureml.train.dnn import PyTorch\n",
"from azureml.core import Environment, ScriptRunConfig\n",
"\n",
"estimator = PyTorch(source_directory=project_folder, \n",
" script_params={'--output-dir': './outputs'},\n",
"pytorch_env = Environment.get(ws, name='AzureML-acpt-pytorch-1.13-cuda11.7')\n",
"\n",
"estimator = ScriptRunConfig(source_directory=project_folder,\n",
" compute_target=compute_target,\n",
" entry_script='mnist.py',\n",
" use_gpu=True)\n",
"\n",
"# upgrade to PyTorch 1.0 Preview, which has better support for ONNX\n",
"estimator.conda_dependencies.remove_conda_package('pytorch=0.4.0')\n",
"estimator.conda_dependencies.add_conda_package('pytorch-nightly')\n",
"estimator.conda_dependencies.add_channel('pytorch')"
" script='mnist.py',\n",
" environment=pytorch_env)"
]
},
{
@@ -578,7 +574,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.6"
"version": "3.9.18"
},
"star_tag": [],
"tags": [
@@ -659,5 +655,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

View File

@@ -245,7 +245,7 @@
"source": [
"from azureml.core import Environment\n",
"\n",
"pytorch_env = Environment.get(ws, name='AzureML-PyTorch-1.6-GPU')"
"pytorch_env = Environment.get(ws, name='AzureML-acpt-pytorch-1.13-cuda11.7')"
]
},
{
@@ -366,7 +366,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.9.18"
},
"tags": [
"None"
@@ -374,5 +374,5 @@
"task": "Train a model using the distributed training via Horovod"
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}

View File

@@ -51,15 +51,15 @@ if args.cuda:
kwargs = {}
# Use Azure Open Datasets for MNIST dataset
# MNIST dataset
datasets.MNIST.resources = [
("https://azureopendatastorage.azurefd.net/mnist/train-images-idx3-ubyte.gz",
("train-images-idx3-ubyte.gz",
"f68b3c2dcbeaaa9fbdd348bbdeb94873"),
("https://azureopendatastorage.azurefd.net/mnist/train-labels-idx1-ubyte.gz",
("train-labels-idx1-ubyte.gz",
"d53e105ee54ea40749a09fcbcd1e9432"),
("https://azureopendatastorage.azurefd.net/mnist/t10k-images-idx3-ubyte.gz",
("t10k-images-idx3-ubyte.gz",
"9fb629c4189551a2d022fa330f9573f3"),
("https://azureopendatastorage.azurefd.net/mnist/t10k-labels-idx1-ubyte.gz",
("t10k-labels-idx1-ubyte.gz",
"ec29112dd5afa0611ce80d1b7f02629c")
]
train_dataset = \

View File

@@ -280,8 +280,7 @@
"# get a curated environment\n",
"env = Environment.get(\n",
" workspace=ws, \n",
" name=\"AzureML-sklearn-1.0-ubuntu20.04-py38-cpu\",\n",
" version=1\n",
" name=\"AzureML-sklearn-1.0\"\n",
")\n",
"env.inferencing_stack_version='latest'\n",
"\n",
@@ -490,7 +489,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.9"
"version": "3.9.18"
},
"notice": "Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.",
"nteract": {