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__)
Pingback: Train Iris data with MinibatchSource using CNTK and C# | Bahrudin Hrnjica Blog
where exactly do we set the cntk path ? i tried environment variables but anaconda 4.1.1. couldnt find cntk wheni tried the import command
a lot of changes made since this post, so I would recommend to see official installation of CNTK. Also CNTK 2.5 installation package doesn’t include dependency components any more, and all are need to be installed separately.
So, if you installed the library, and after installation you have a problem that the system doesn’t recognized the library, maybe some components are missing.
I would recommend this link for proper installation:
Also, if you are trying to use Visual Studio and CNTK, first test CNTK library from the command line. Once you sure the library is installed properly on your system, then go to Visual Studio, and see if you can see the Python environment you have installed the CNTK in visual studio, and try. In case you cant see the python environment, then try to import the missing environment through the visual studio Python tool.
Hope this help.