Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


This folder contains the CNTK python implementation of the ResNet model. The original official repo is here.

Prepare Dataset

The original directory of CNTK ResNet contains code for cifar10 and imagenet datasets. In our benchmark, we use the imagenet1K dataset.

To use our benchmark, first prepare the dataset according to the following steps:

1, Download and decompress the imagenet1K 2012 dataset. Note that you need to sign up for an account at to download the dataset. Rename and move your deceompressed directories so that the raw data folder looks like this:


2, Copy dataset/ & dataset/ to ImageNet1K/ImageNet_train/, and dataset/ILSVRC2012_validation_ground_truth.txt & dataset/ to ImageNet1K/ImageNet_val/

3, Generate train_map.txt and val_map.txt by:

python3.5 $DATA_DIR
cd ../ImageNet_val

Get CNTK Executable

Currently we provide CNTK BrainScript supported by CNTK-2.0. We will update to latest version of CNTK in future release.

To train the model with CNTK BrainScript, obtain the CNTK executable by following:
1, Install open MPI by sudo apt-get install libopenmpi-dev;
2, Download and decompress CNTK-2.0 GPU version for Linux here. To use other version, check here (Please download the release, not the source code);
3, Add dependency libs to the environment by:

export LD_LIBRARY_PATH=LD_LIBRARY_PATH:<PATH/TO/cntk/cntk/dependencies/lib>

4, You should find the cntk executable in <PATH/TO/cntk/cntk/bin/cntk>.

Run Training

To start the training of ResNet-50 with mini-batch size x with CNTK BrainScript, you need to:
1, Change the DataDir variable in source/BrainScript/ResNet50_ImageNet1K.cntk to <ABS_PATH_TO_ImageNet1K/ImageNet_train/>;
2, Modify the minibatchSize variable to x;
3, start the training by:

<PATH/TO/cntk/cntk/bin/cntk> configFile=ResNet50_ImageNet1K.cntk

To train ResNet-152, change the DataDir & minibatchSize variables accordingly, then start the training by:

<PATH/TO/cntk/cntk/bin/cntk> configFile=ResNet152_ImageNet1K.cntk
You can’t perform that action at this time.