Skip to content

Commit 349029b

Browse files
authored
Merge pull request #188723 from lgayhardt/azml-tensorflow-0222
Freshness TensorFlow
2 parents 4be0485 + 15aedee commit 349029b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

articles/machine-learning/how-to-train-tensorflow.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.service: machine-learning
77
ms.subservice: core
88
ms.author: minxia
99
author: mx-iao
10-
ms.date: 09/28/2020
10+
ms.date: 02/23/2022
1111
ms.topic: how-to
1212

1313
# Customer intent: As a TensorFlow developer, I need to combine open-source with a cloud platform to train, evaluate, and deploy my deep learning models at scale.
@@ -26,8 +26,7 @@ Whether you're developing a TensorFlow model from the ground-up or you're bringi
2626
Run this code on either of these environments:
2727

2828
- Azure Machine Learning compute instance - no downloads or installation necessary
29-
30-
- Complete the [Quickstart: Get started with Azure Machine Learning](quickstart-create-resources.md) to create a dedicated notebook server pre-loaded with the SDK and the sample repository.
29+
- Complete the [Quickstart: Get started with Azure Machine Learning](quickstart-create-resources.md) to create a dedicated notebook server pre-loaded with the SDK and the sample repository.
3130
- In the samples deep learning folder on the notebook server, find a completed and expanded notebook by navigating to this directory: **how-to-use-azureml > ml-frameworks > tensorflow > train-hyperparameter-tune-deploy-with-tensorflow** folder.
3231

3332
- Your own Jupyter Notebook server
@@ -82,7 +81,7 @@ web_paths = [
8281
'http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz',
8382
'http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz'
8483
]
85-
dataset = Dataset.File.from_files(path=web_paths)
84+
dataset = Dataset.File.from_files(path = web_paths)
8685
```
8786

8887
Use the `register()` method to register the data set to your workspace so they can be shared with others, reused across various experiments, and referred to by name in your training script.
@@ -126,6 +125,7 @@ For more information on compute targets, see the [what is a compute target](conc
126125
To define the Azure ML [Environment](concept-environments.md) that encapsulates your training script's dependencies, you can either define a custom environment or use an Azure ML curated environment.
127126

128127
#### Use a curated environment
128+
129129
Azure ML provides prebuilt, curated environments if you don't want to define your own environment. Azure ML has several CPU and GPU curated environments for TensorFlow corresponding to different versions of TensorFlow. For more info, see [Azure ML Curated Environments](resource-curated-environments.md).
130130

131131
If you want to use a curated environment, you can run the following command instead:
@@ -136,17 +136,23 @@ tf_env = Environment.get(workspace=ws, name=curated_env_name)
136136
```
137137

138138
To see the packages included in the curated environment, you can write out the conda dependencies to disk:
139+
139140
```python
141+
140142
tf_env.save_to_directory(path=curated_env_name)
141143
```
142144

143145
Make sure the curated environment includes all the dependencies required by your training script. If not, you'll have to modify the environment to include the missing dependencies. If the environment is modified, you'll have to give it a new name, as the 'AzureML' prefix is reserved for curated environments. If you modified the conda dependencies YAML file, you can create a new environment from it with a new name, for example:
146+
144147
```python
148+
145149
tf_env = Environment.from_conda_specification(name='tensorflow-2.2-gpu', file_path='./conda_dependencies.yml')
146150
```
147151

148152
If you had instead modified the curated environment object directly, you can clone that environment with a new name:
153+
149154
```python
155+
150156
tf_env = tf_env.clone(new_name='tensorflow-2.2-gpu')
151157
```
152158

@@ -221,7 +227,9 @@ The [Run object](/python/api/azureml-core/azureml.core.run%28class%29) provides
221227
run = Experiment(workspace=ws, name='Tutorial-TF-Mnist').submit(src)
222228
run.wait_for_completion(show_output=True)
223229
```
230+
224231
### What happens during run execution
232+
225233
As the run is executed, it goes through the following stages:
226234

227235
- **Preparing**: A docker image is created according to the environment defined. The image is uploaded to the workspace's container registry and cached for later runs. Logs are also streamed to the run history and can be viewed to monitor progress. If a curated environment is specified instead, the cached image backing that curated environment will be used.

0 commit comments

Comments
 (0)