You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Tutorial: Deploy a pre-trained image classification model to Azure Functions with PyTorch
12
12
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.
14
14
15
15
> [!div class="checklist"]
16
16
> * 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
157
157
158
158
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.
159
159
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:
> 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
+
170
173
1. Save *requirements.txt*, then run the following command from the *start* folder to install the dependencies.
171
174
172
175
@@ -195,7 +198,7 @@ Installation may take a few minutes, during which time you can proceed with modi
195
198
>
196
199
> In a production application, change `*` to the web page's specific origin for added security.
197
200
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.
0 commit comments