• Stars
    star
    215
  • Rank 183,925 (Top 4 %)
  • Language
    Python
  • Created almost 7 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This is the PyTorch implement of ResNeXt (train on ImageNet dataset)

Paper: Aggregated Residual Transformations for Deep Neural Networks

Usage

Prepare data

This code takes ImageNet dataset as example. You can download ImageNet dataset and put them as follows. I only provide ILSVRC2012_dev_kit_t12 due to the restriction of memory, in other words, you need download ILSVRC2012_img_train and ILSVRC2012_img_val.

β”œβ”€β”€ train.py # train script
β”œβ”€β”€ resnext.py # network of resnext
β”œβ”€β”€ read_ImageNetData.py # ImageNet dataset read script
β”œβ”€β”€ ImageData # train and validation data
	β”œβ”€β”€ ILSVRC2012_img_train
		β”œβ”€β”€ n01440764
		β”œβ”€β”€    ...
		β”œβ”€β”€ n15075141
	β”œβ”€β”€ ILSVRC2012_img_val
	β”œβ”€β”€ ILSVRC2012_dev_kit_t12
		β”œβ”€β”€ data
			β”œβ”€β”€ ILSVRC2012_validation_ground_truth.txt
			β”œβ”€β”€ meta.mat # the map between train file name and label

Train

  • If you want to train from scratch, you can run as follows:
python train.py --batch-size 256 --gpus 0,1,2,3
  • If you want to train from one checkpoint, you can run as follows(for example train from epoch_4.pth.tar, the --start-epoch parameter is corresponding to the epoch of the checkpoint):
python train.py --batch-size 256 --gpus 0,1,2,3 --resume output/epoch_4.pth.tar --start-epoch 4