1

I am trying to play with the alexnet code in the /mxnet/example/image-classification/symbols directory using MxNet Framework. I am not an expert in AI. Can some explain explain how to run it using GPUs? I have tried the following for single GPU:

python alexnet.py --network resnet --num-layers 110 --batch-size 128 --gpus 0

It didn't do anything. I have HPC background. I want to test the scalability of this framework per node and across the nodes ( distributed ). Any help would be appreciated.

Thanks,

  • [alexnet.py](https://github.com/dmlc/mxnet/blob/master/example/image-classification/symbols/alexnet.py) only contains a function so obviously it doesn't do anythin when invoked directly. I haven't use mxnet before but according to the [readme](https://github.com/dmlc/mxnet/blob/master/example/image-classification/README.md) you can try train a resnet on [cifar10](https://www.cs.toronto.edu/~kriz/cifar.html) dataset by calling: `python train_cifar10.py --network resnet --num-layers 110 --batch-size 128 --gpus 0` – Yohanes Gultom Mar 02 '17 at 02:53

1 Answers1

2

the alexnet.py (along with the other Python files in examples/image-classification/symbols folder) only returns symbols that represent the network.

First download and unarchive your dataset:

/mxnet/example/image-classification/data# wget http://www.image-net.org/image/whatever-zip-or-tar-file
/mxnet/example/image-classification/data# unzip whatever-zip-or-tar-file

Convert data format to RecordIO:

/mxnet/example/image-classification/data# python ../../../tools/im2rec.py --list True --recursive True --train-ratio 0.95 mydata tiny-imagenet-200
/mxnet/example/image-classification/data# python ../../../tools/im2rec.py --num-thread 16 mydata tiny-imagenet-200

Use train_imagenet.py script to train on alexnet (you may switch to any of the other symbols if you wish):

/mxnet/example/image-classification/data# cd ..
/mxnet/example/image-classification# python train_imagenet.py --network alexnet --data-train /mxnet/example/image-classification/data/mydata_train.rec --data-val /mxnet/example/image-classification/data/mydata_val.rec --num-layers 110 --batch-size 64 --gpus 0

Take a look at the README for more details.

lynguyen
  • 131
  • 6