Skip to content

Commit 92bf4a7

Browse files
author
Gopal K. Vashishtha
committed
final pass
1 parent 1b4f453 commit 92bf4a7

File tree

1 file changed

+6
-24
lines changed

1 file changed

+6
-24
lines changed

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

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In this article, you learn how to use Python, PyTorch, and Azure Functions to lo
2222
## Prerequisites
2323

2424
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?ref=microsoft.com&utm_source=microsoft.com&utm_medium=docs&utm_campaign=visualstudio).
25-
- [Python 3.7.4](https://www.python.org/downloads/release/python-374/). (Python 3.7.4 and Python 3.6.x are verified with Azure Functions; Python 3.8 and later versions are not yet supported.)
25+
- [Python 3.7.4 or above](https://www.python.org/downloads/release/python-374/). (Python 3.8.x and Python 3.6.x are also verified with Azure Functions.)
2626
- The [Azure Functions Core Tools](functions-run-local.md#install-the-azure-functions-core-tools)
2727
- A code editor such as [Visual Studio Code](https://code.visualstudio.com/)
2828

@@ -42,7 +42,7 @@ In this article, you learn how to use Python, PyTorch, and Azure Functions to lo
4242
1. Navigate into the folder and examine its contents.
4343
4444
```
45-
cd functions-pytorch
45+
cd functions-python-pytorch-tutorial
4646
```
4747
4848
- *start* is your working folder for the tutorial.
@@ -52,20 +52,14 @@ In this article, you learn how to use Python, PyTorch, and Azure Functions to lo
5252
5353
## Create and activate a Python virtual environment
5454
55-
Navigate to the *start* folder and run the following commands to create and activate a virtual environment named `.venv`. Be sure to use Python 3.7, which is supported by Azure Functions.
55+
Navigate to the *start* folder and run the following commands to create and activate a virtual environment named `.venv`.
5656
5757
5858
# [bash](#tab/bash)
5959
6060
```bash
6161
cd start
62-
```
63-
64-
```bash
6562
python -m venv .venv
66-
```
67-
68-
```bash
6963
source .venv/bin/activate
7064
```
7165

@@ -79,27 +73,15 @@ sudo apt-get install python3-venv
7973

8074
```powershell
8175
cd start
82-
```
83-
84-
```powershell
8576
py -m venv .venv
86-
```
87-
88-
```powershell
8977
.venv\scripts\activate
9078
```
9179

9280
# [Cmd](#tab/cmd)
9381

9482
```cmd
9583
cd start
96-
```
97-
98-
```cmd
9984
py -m venv .venv
100-
```
101-
102-
```cmd
10385
.venv\scripts\activate
10486
```
10587

@@ -226,10 +208,10 @@ Installation may take a few minutes, during which time you can proceed with modi
226208
func start
227209
```
228210
229-
1. In a browser, open the following URL to invoke the function with the URL of a cat image and confirm that the returned JSON classifies the image as a cat.
211+
1. In a browser, open the following URL to invoke the function with the URL of a Bernese Mountain Dog image and confirm that the returned JSON classifies the image as a Bernese Mountain Dog.
230212
231213
```
232-
http://localhost:7071/api/classify?img=http://localhost:7071/api/classify?img=https://raw.githubusercontent.com/Azure-Samples/functions-python-pytorch-tutorial/master/resources/assets/Bernese-Mountain-Dog-Temperament-long.jpg
214+
http://localhost:7071/api/classify?img=https://raw.githubusercontent.com/Azure-Samples/functions-python-pytorch-tutorial/master/resources/assets/Bernese-Mountain-Dog-Temperament-long.jpg
233215
```
234216
235217
1. Keep the host running because you use it in the next step.
@@ -270,7 +252,7 @@ To test invoking the function endpoint from another web app, there's a simple ap
270252
271253
1. Select **Submit** to invoke the function endpoint to classify the image.
272254
273-
![Screenshot of finished project](media/functions-machine-learning-pytorch/screenshot.png)
255+
![Screenshot of finished project](media/machine-learning-pytorch/screenshot.png)
274256
275257
If the browser reports an error when you submit the image URL, check the terminal in which you're running the function app. If you see an error like "No module found 'PIL'", you may have started the function app in the *start* folder without first activating the virtual environment you created earlier. If you still see errors, run `pip install -r requirements.txt` again with the virtual environment activated and look for errors.
276258

0 commit comments

Comments
 (0)