-
Notifications
You must be signed in to change notification settings - Fork 798
Early Exit Inference #103
Comments
2018-12-11 17:11:12,837 - Log file for this run: /media/walker/DATA/work/new_quant/distiller/examples/classifier_compression/logs/2018.12.11-171112/2018.12.11-171112.log |
resnet20_cifar_earlyexit has only 1 earlyexit. |
Thanks! => using early-exit threshold values of [0.9] Training epoch: 45000 samples (256 per mini-batch) Parameters: --- validate (epoch=0)----------- Log file for this run: /media/walker/DATA/work/new_quant/distiller/examples/classifier_compression/logs/2018.12.11-182354/2018.12.11-182354.log |
Hi - this is because the newer Pytorch 1.0 is deprecating the "reduce" parameter and using "reduction" Either update to Pytorch 1.0 - or if you don't want to use the pre-release version, then change that line in the code to |
I found this problem, too. |
To be consistent with the rest of Distiller (which assumes version 0.4.0 of Pytorch), I will be taking the parameter back to the 0.4.0 method of calling. The parameter should be If you want to run right now - make the change yourself. I'll be submitting a patch in the upcoming day or two. |
@haim-barad It works. Thanks! |
How to train an early exit model? Here is the command I used:
python3 compress_classifier.py --arch resnet20_cifar_earlyexit ../../../data.cifar10 -p=50 --lr=0.3 --epochs=180 --compress=../cifar10/resnet20/resnet20_cifar_baseline_training.yaml -j=1 --deterministic --earlyexit_thresholds 0.9 1.2 --earlyexit_lossweights 0.2 0.3
But Distiller shows me the following error message:
Log file for this run: /media/walker/DATA/work/new_quant/distiller/examples/classifier_compression/logs/2018.12.11-162919/2018.12.11-162919.log
==> using cifar10 dataset
=> creating resnet20_cifar_earlyexit model for CIFAR10
Logging to TensorBoard - remember to execute the server:
=> using early-exit threshold values of [0.9, 1.2]
Optimizer Type: <class 'torch.optim.sgd.SGD'>
Optimizer Args: {'dampening': 0, 'weight_decay': 0.0001, 'momentum': 0.9, 'nesterov': False, 'lr': 0.3}
Files already downloaded and verified
Files already downloaded and verified
Dataset sizes:
training=45000
validation=5000
test=10000
Reading compression schedule from: ../cifar10/resnet20/resnet20_cifar_baseline_training.yaml
Training epoch: 45000 samples (256 per mini-batch)
Log file for this run: /media/walker/DATA/work/new_quant/distiller/examples/classifier_compression/logs/2018.12.11-162919/2018.12.11-162919.log
Traceback (most recent call last):
File "compress_classifier.py", line 789, in
main()
File "compress_classifier.py", line 386, in main
loggers=[tflogger, pylogger], args=args)
File "compress_classifier.py", line 477, in train
loss = earlyexit_loss(output, target, criterion, args)
File "compress_classifier.py", line 645, in earlyexit_loss
loss += (1.0 - sum_lossweights) * criterion(output[args.num_exits-1], target)
IndexError: list index out of range
resnet20_cifar_baseline_training.yaml ==>
lr_schedulers:
training_lr:
class: StepLR
step_size: 45
gamma: 0.10
policies:
- lr_scheduler:
instance_name: training_lr
starting_epoch: 45
ending_epoch: 200
frequency: 1
The text was updated successfully, but these errors were encountered: