mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

image-classification for 21k classes

Open GeorgeXia1828 opened this issue 10 years ago • 5 comments

As it write in http://mxnet.readthedocs.org/en/latest/tutorial/imagenet_full.html

The key ingredients are Store the images in jpeg format, and pack them into binary record. Split the list, and pack several record files, instead of one file. This allows us to pack the images in distributed fashion, because we will be eventually bounded by the IO cost during packing. We need to make the package being able to read from several record files, which is not too hard. This will allow us to store the entire imagenet dataset in around 250G space. After packing, together with threaded buffer iterator, we can simply achieve an IO speed of around 3,000 images/sec on a normal HDD.

But use train_model.fit I can only load train data in one time, how can I manage the "splitter" train.rec. I am not very clear here.

GeorgeXia1828 avatar Apr 15 '16 07:04 GeorgeXia1828

I'm interested too, I'm doing something similar to the 1k classes problem, and I have multiple .rec files after the im2rec.py script invocation since the dataset was too big. I'm inspecting the training scripts but it seems there is no parameter to specify that the input is divided in multiple files.

For example train_imagenet.py allows to specify --data-dir and --train-dataset parameters, but seems that then in the iterator creation:

...
    train = mx.io.ImageRecordIter(
        path_imgrec = os.path.join(args.data_dir, args.train_dataset),
...

this will result just in a single file path.

Should I implement my ImageRecordIter? (However, wasn't this script used for the 21k example? I don't think this experiment was performed having the entire train/val dataset in a single file).

luatzori avatar Apr 20 '16 15:04 luatzori

You can just put all files in a folder, and specify folder a the image path

tqchen avatar Apr 20 '16 15:04 tqchen

What do you mean? For example, again using train_imagenet.py, the --train-dataset parameter has train.rec as default value. Can you give me an example of how to launch the script having all the .rec chunks in a folder?

luatzori avatar Apr 21 '16 09:04 luatzori

put all the training rec files in a folder say mydata, and put it under your data folder, set --train-dataset to mydata should do the job

tqchen avatar Apr 21 '16 15:04 tqchen

closing as the last post answers the question

tqchen avatar Apr 26 '16 22:04 tqchen