Skip to content

Commit

Permalink
corrected imagenet learning rate
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasverelst committed Jun 18, 2020
1 parent a29b33f commit b586cd5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions classification/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,30 +68,31 @@ smaller models are Resnet 26, 20, 14 and 8, e.g.

## ResNet-101 on ImageNet-1K

Note: Specify the path of your imagenet dataset using the `--dataset-root` argument, or change the path in the `main_imagenet.y` file.

### Evaluate a pretrained sparse DynConv network

python main_imagenet.py --batchsize 64 -r exp/imagenet/resnet101/sparse03/checkpoint_best.pth --budget 0.3 -e
python main_imagenet.py -r exp/imagenet/resnet101/sparse03/checkpoint_best.pth --budget 0.3 -e

should result in

>\* Epoch 97 - Prec@1 75.710
>\* FLOPS (multiply-accumulates, MACs) per image: 2997.180928 MMac
use the `--plot_ponder` flag to visualize the ponder cost maps (computation heatmaps):
python main_imagenet.py --batchsize 64 -r exp/imagenet/resnet101/sparse03/checkpoint_best.pth --budget 0.3 -e --plot_ponder
python main_imagenet.py -r exp/imagenet/resnet101/sparse03/checkpoint_best.pth --budget 0.3 -e --plot_ponder


Likewise:

python main_imagenet.py --batchsize 64 -r exp/imagenet/resnet101/sparse05/checkpoint_best.pth --budget 0.5 -e
python main_imagenet.py -r exp/imagenet/resnet101/sparse05/checkpoint_best.pth --budget 0.5 -e

python main_imagenet.py --batchsize 64 -r exp/imagenet/resnet101/sparse07/checkpoint_best.pth --budget 0.7 -e
python main_imagenet.py -r exp/imagenet/resnet101/sparse07/checkpoint_best.pth --budget 0.7 -e

python main_imagenet.py --batchsize 64 -r exp/imagenet/resnet101/sparse08/checkpoint_best.pth --budget 0.8 -e
python main_imagenet.py -r exp/imagenet/resnet101/sparse08/checkpoint_best.pth --budget 0.8 -e



### Evaluate a pretrained baseline

python main_imagenet.py --batchsize 64 -r exp/imagenet/resnet101/base/checkpoint_best.pth -e
python main_imagenet.py -r exp/imagenet/resnet101/base/checkpoint_best.pth -e
2 changes: 1 addition & 1 deletion classification/main_imagenet.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

def main():
parser = argparse.ArgumentParser(description='PyTorch ImageNet Training with sparse masks')
parser.add_argument('--lr', default=0.1, type=float, help='learning rate')
parser.add_argument('--lr', default=0.025, type=float, help='learning rate')
parser.add_argument('--lr_decay', default=[30,60,90], nargs='+', type=int, help='learning rate decay epochs')
parser.add_argument('--momentum', default=0.9, type=float, help='momentum')
parser.add_argument('--weight_decay', default=1e-4, type=float, help='weight decay')
Expand Down

0 comments on commit b586cd5

Please sign in to comment.