Skip to content

Commit 71e028a

Browse files
Merge pull request #223013 from vmagelo/freshness-work2
Freshness work.
2 parents 5e3a9da + 5a718a4 commit 71e028a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

articles/azure-functions/machine-learning-pytorch.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ title: Deploy a PyTorch model as an Azure Functions application
33
description: Use a pre-trained ResNet 18 deep neural network from PyTorch with Azure Functions to assign 1 of 1000 ImageNet labels to an image.
44

55
ms.topic: tutorial
6-
ms.date: 02/28/2020
6+
ms.date: 01/05/2023
77
ms.custom: devx-track-python, devx-track-azurepowershell, py-fresh-zinc
88

99
---
1010

1111
# Tutorial: Deploy a pre-trained image classification model to Azure Functions with PyTorch
1212

13-
In this article, you learn how to use Python, PyTorch, and Azure Functions to load a pre-trained model for classifying an image based on its contents. Because you do all work locally and create no Azure resources in the cloud, there is no cost to complete this tutorial.
13+
In this article, you learn how to use Python, PyTorch, and Azure Functions to load a pre-trained model for classifying an image based on its contents. Because you do all work locally and create no Azure resources in the cloud, there's no cost to complete this tutorial.
1414

1515
> [!div class="checklist"]
1616
> * Initialize a local environment for developing Azure Functions in Python.
@@ -157,16 +157,19 @@ To modify the `classify` function to classify an image based on its contents, yo
157157
158158
1. Verify that the *classify* folder contains files named *predict.py* and *labels.txt*. If not, check that you ran the command in the *start* folder.
159159
160-
1. Open *start/requirements.txt* in a text editor and add the dependencies required by the helper code, which should look like the following:
160+
1. Open *start/requirements.txt* in a text editor and add the dependencies required by the helper code, which should look like:
161161
162162
```txt
163163
azure-functions
164164
requests
165165
-f https://download.pytorch.org/whl/torch_stable.html
166-
torch==1.5.0+cpu
167-
torchvision==0.6.0+cpu
166+
torch==1.13.0+cpu
167+
torchvision==0.14.0+cpu
168168
```
169169
170+
> [!Tip]
171+
> The versions of torch and torchvision must match values listed in the version table of the [PyTorch vision repo](https://github.com/pytorch/vision).
172+
170173
1. Save *requirements.txt*, then run the following command from the *start* folder to install the dependencies.
171174
172175
@@ -195,7 +198,7 @@ Installation may take a few minutes, during which time you can proceed with modi
195198
>
196199
> In a production application, change `*` to the web page's specific origin for added security.
197200
198-
1. Save your changes, then assuming that dependencies have finished installing, start the local function host again with `func start`. Be sure to run the host in the *start* folder with the virtual environment activated. Otherwise the host will start, but you will see errors when invoking the function.
201+
1. Save your changes, then assuming that dependencies have finished installing, start the local function host again with `func start`. Be sure to run the host in the *start* folder with the virtual environment activated. Otherwise the host will start, but you'll see errors when invoking the function.
199202
200203
```
201204
func start

0 commit comments

Comments
 (0)