Skip to content

Recommended CNTK 2.0 Setup

sayanpa edited this page Oct 22, 2016 · 29 revisions

CNTK V2 Setup and Installation

You can install CNTK with in three different ways on Windows and Linux :

[Note: The CNTK v2 APIs are an alpha release for early users to try and provide feedback on the usability and functional aspects of the API.]

Language Support:

CNTK V2 provides Python and C++ APIs. These APIs enables programmatically defining CNTK models and drive their training/evaluation, using either built-in data readers or user supplied data in native Python numpy/C++ arrays.

  • Python:
    • CNTK V2 with Python APIs is supported natively on Windows with Python 3.4.4 and on Linux with Python 3.5. For both the platforms one can create a 3.4.4 python environment within any Anaconda (Python 2.7 or 3.x version).
  • Brainscript:
    • CNTK V2 also supports the BrainScript framework.

Binary installation with scripts (recommended)

There are two steps in CNTK V2 binary installation:

Step 1: Prerequisites installation

Step 2: Python (Anaconda environment) installation and CNTK V2 binary package installation

Step 3: Clone from Github examples and tutorials

Please follow the links for:

  1. Windows
  2. Linux

Installation steps for Windows

Please follow the steps below to install the binaries. The script will additionally clone the CNTK repository into C:\repos\cntk.

Step 1: Prepare to run PowerShell scripts:

  • Downloaded the scripts from here. Unzip/extract in a local folder say C:\scripts. One can create the director by executing mkdir C:\scripts from a Windows command prompt.
  • Open PowerShell with administrator priviledges
  • Click on Windows Start
  • Search for Windows PowerShell (see below), Right click on the icon and select Run as administrator

  • Type and run: set-executionpolicy -executionpolicy unrestricted. Upon being prompted, select A

  • Close the PowerShell window
  • Start a new Windows PowerShell application similar to previous step (not in Administrator mode )

Step 2: Run PowerShell scripts

Step 3: Run Python setup

Open a windows command window or an anaconda command window

  • Run: [Anaconda install folder root]\Scripts\activate cntk-py34

  • If you want to deploy a new CNTK wheel package at a later time simply re-run:

  • Run: pip install –upgrade [Location of the wheel file]

Installation steps for Linux

Please follow the steps below to install the binaries. The script will additionally clone the CNTK repository into /home/[USERNAME]/repos/cntk. Note: we have tested the script on Ubuntu 16.0.4. We first summarize what the script installs for you and sets the environment variables.

Step 1: Prepare to run scripts:

  • Downloaded the scripts from here. Create a directory under /home/[USERNAME] and unzip the scripts in that folder.

Step 2: Run the bash scripts:

Run: bash pycntkv2_linux_install.sh <url-of-wheel>

Step 3: Python updates

  • RUN: source $HOME/anaconda3/bin/activate $HOME/anaconda3/envs/cntk-py34 to activate the python environment after the environment updates are completed.

  • If you want to deploy a new CNTK wheel package at a later time simply re-run: pip install –upgrade [Whl file location]

The script installs a CNTK Python 3.4 environment with Anaconda 4.1.1 located at $HOME/anaconda3/envs/cntk-py34 with all packages required for CNTK v2 Python and notebooks.

Clone this wiki locally