In the next few steps will show how to install CNTK and python environment in Visual Studio 2017.
- First download the latest CNTK version from the official GitHub page, or just click on the following link: https://github.com/Microsoft/CNTK/releases
The release page will show the latest bits. Click on the CPU only package, accept the license and download the zip file.
- Once that you have zip file on your PC, create the folder C:/local on disk and unzip the package in to it.
- The next step performs the installation of the library as well as installation of the Python related distribution anaconda 4.1.1.
- Open C:\local\cntk\Scripts\install\windows path and run install.bat file. You will need administrative rights in order to successfully install all required components.
- The following image shows the installation process:
- As can be seen first you have to run batch file (step 2), then press 1 and ENTER in order to continue with the installation process and press ‘y‘, to perform downloading required components.
- The installation process takes several minutes to complete. The first component to be installed is Anaconda 4.1.1 which is needed in order to setup CNTK.
- Once the anaconda is installed, the process of CNTK installation starts and passes very quickly since we already download all CNTK bits.
- Now that we have CNTK installed, the last installation step is installation of the Visual Studio Tool for Python.
- Run the Visual Studio 2017 Installer and after the installed is show, just select the python components similar picture shows below:
- Once the installation is completed run Visual Studio 2017.
- From the Visual Studio 2017 Tool menu select Python and then select Python Environment:
- From the Python Environment window select Anaconda 4.1.1 and update symbols DB, by pressing the button pointed on the image below:
- Once we have environment updated, Press “Make this the default environment for the new projects” option in order to apply the environment for the future Python CNTK based projects.
- Also the path for Python and Python scripts should be registered in Global Environment OS.
- Once the previous steps are performed successfully, we can start writing CNTK aware python code in Visual Studio 2017.
- OPen VS 2017 and Anaconda 4.1.1 environment and type.
print(“CNTK verion:”, cntk__version__)
- Similar output should be appear
- print(“CNTK version:”, cntk.__version__)
Microsoft has released Microsoft R Server 9.0 (MRS9.0) with very interesting package called MicrosoftML. “Micrsooft ML” stands for Microsoft Machine Learning R package which you can use on R Server. R Server is commercial version of popular R Client distribution, which solves mayor problems when working with R. R Server contains set of cutting-edge technology to work with big data, as well as set of enhanced packages for parallelization and distributing computing.
MRS 9.0 is coming with “MicrosoftML” package which contains set of several Machine Learning algorithms developed in various Microsoft products in the last 10 years. You can combine the algorithms delivered in this package with pre-existing parallel external memory algorithms such as the RevoScaleR package as well as open source innovations such as CRAN R packages to deliver the best predictive analytic.
MicrosoftML package includes the following algorithms:
- Fast linear learner, with support for L1 and L2 regularization,
- Fast boosted decision tree,
- Fast random forest,
- Logistic regression, with support for L1 and L2 regularization,
- GPU-accelerated Deep Neural Networks (DNNs) with convolutions,
- Binary classification using a One-Class Support Vector Machine.
How to start with MicrosoftML package
In order to fully use the power of MicrosoftML, and RevoScaleR you need to download MRS 9.0 from the MSDN or Visual Studio Dev Essentials subscription. Once the zip file is downloaded, unzip it, and run setup file.
The following required components were missing when my installation is started. Seems the MRS contains the latest .NET Core components, which is pretty cool:
After the prerequested components installed, the MRS installation process can start.
By clicking the Next button the Installation process starts:
Select the path where you want to install MRS, and press the Next button:
If everything went ok, the installation process is finished after less than minute, and the final dialog window appears:
By clicking the Finish button MRS is installed on you PC.
Run MRS 9.0 by using R Tool fo Visual Studio, RTVS
Now it is time to run some R code. YOu have two posibilities to run R code. The first option is that you use the R Studio proffesion tool for running R code. It is free and open source which you can download from rstudio.com. If you are MS Developer you usualy write the code in the Visual Studio. So you can download RTVS from this link and run R code from Visual Studio.
Now that you have right tool to run R code, we can start with setting the MRS environment.
First thing you should do is to point RTVS to use MRS 9.0 instead of curently using some other distribution. So open the Visual Studio, select R Tools->Edit Options
The Option dialog appears. Set the R Engine to point installation folder of the MRS. Since my installation location was on Program Files folder, the picture below show my installation path.
After you set the right installation folder , restart the Visual Studio:
When the Visual Studio is running, open R Open R Interactive window. You should have similar text if you set up MRS path correctly:
Select New Project from the File->New menu option.
Name it FirstRServerDemo and click Ok. Now you are ready to write first MRS R code:
In the next post we will continue exploration the MicrosoftML library package and new set of Machine Learning algorithms added in this latest version.
Today, I gave session at Advanced Technology Day conference in Zagreb. It was very excited to see full room of people at the presentation, mostly developers from .NET world interesting in R and Data Science. This is good sign that the Data Science and the R are becoming more and more popular at daily basis. Most popularity for the R will bring R Tool for Visual Studio, which means the R language became member of the family of the Visual Studio.
For those who were asking about my slides and demo sample here is the information:
- Presentation slides can be downloaded here,
- Source code of the demo is hosted at git hub at: http://github.com/bhrnjica/R-Workshop
- For more information about R , you can see my YouTube channel about R and Machine Learning at this link.
See you next time!
The new version of Visual Studio will come with dramatically new installer, which will allow that you install only stuff you need, without gigabytes of unnecessary never used components. Current version of Visual Studio which is Visual Studio 2015 Update 3 is coming with nearly 8GB installation file. This is to much for the installer, you need special condition when you want to download the installation file. I am doing it by night, when I am sleeping. In some condition the installation process takes an hour to install everything you have specified.
In the next version the installation process will be changed and if you want to see and feel how the future visual studio installer will look like you can download the preview of the Visual Studio vnext code name “Visual Studio 15” at this link.
If you try to install Visual Studio 15 preview 3, it will take less than 5 minutes, with very simple installer. In the next five pictures whole installation process is completed.
After you download the installer, run it and the following pictures will appear:
- First picture is asking to confirm the installation process:
2. The next picture shows the progress of loading installer
3. The next picture is the main picture which you can select what to install. The whole Visual Studio installer is devided in to the development groups:
- Core Stuff of the Visual Studio- this component is required for all developer group
- There are for now 4 installer groups: .NET, C++, Python, Game dev.
- The more will come later.
4. After you select right developer group/groups installation process starts by pressing Install button.
5. After the installation process is completed, the following picture appear, which you only need to close by pressing the Close button at the right top edge of the window.
As we can see the next version of the Visual Studio will dramatically changed the installation process, offering new simple and effective installer.