Click on Deploy to Azure button. Once Deployment is successful, you can RDP into the VM using its public IP address.
STEP 2: Develop Python Code/Model.
There are many ways to run ML Server python. We will discuss the following ways:
Python Tools for Visual Studio
Visual Studio Code
(You can choose any of the above methods in which you are comfortable to develop the python code/model)
You can simply start a python terminal by double clicking the following exe :
C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\python.exe
And start typing python code (or) copy paste python code.
MLServer comes with a jupyter notebook executable that can be found in the following location:
C:\Program Files\Microsoft\ML Server\PYTHON_SERVER\Scripts\jupyter-notebook.exe
Right-click Run as administrator on jupyter-notebook.exe
The Notebook Dashboard opens in your default browser at http://localhost:8888/tree
If you have an existing Jupyter Notebook, you can use the upload button on the top right to load the .ipynb file. If you wish to develop from scratch, click on New and choose MLO16N
This will open a new tab with MLO16N kernel and you can start typing code :
Open Visual Studio 2017 as Administrator. (you can find it as taskbar icon)
Click on File -> New -> Project
Choose Python on the left side and create a Python Application Project. (choose ‘From existing python code’ if you already have python code)
Once the project is open, you can start typing python code.
We will now point Visual Studio to ML Server Python Interpreter directly.
Go to View > Other Windows > Python Environments.
Click on Custom and Fill the following values:
Click Apply. Now you should see a Machine Learning Server environment with details:
Now you can click Open Interactive Window and start typing code interactively:
If we wish to use Machine Learning Server Python Environment in our Python Application Project, we can add it by right clicking the Python Environment and choosing Add/Remove Python Environments
Now we can add code to PythonApplication1.py file.
Once we add python code, we can select a particular python code and run it in Interactive Window by pressing Ctrl+Enter or right click the selected code and click on ‘Send to Interactive’.
Also, you can set breakpoints and debug your python code.
Visual Studio Code
VS code is a lightweight IDE alternative to Visual Studio. You can open VS Code from the taskbar.
We will install Python Extension by clicking on extensions on left banner and searching python :
Once installed, close and open VS Code.
Create a new python file and add some python code.
Click on File -> Preference -> Settings
Search python.pythonPath setting and add our custom ML Server Python path value on the right hand side :
"python.pythonPath": "C:\\Program Files\\Microsoft\\ML Server\\PYTHON_SERVER\\python.exe"
Save User Settings and restart VS Code.
Open View -> Command palette and type >Python: Select Interpreter and choose Machine Learning Server
Now you can type python code. Select code, right click and choose Run Selection/Line in python terminal. This will open ML Server python in an Intergrated Terminal below and execute the line of python code.