MBQuant: A Novel Multi-Branch Topology Method for Arbitrary Bit-width Network Quantization paper
- See requirements.txt
python main_cifar.py --data PathForCIFAR \
--visible_gpus '0' --multiprocessing_distributed False \
--dist_url 'tcp://127.0.0.1:23456' \
--workers 4 --datasetsname cifar100 \
--arch 'resnet20_quant' \
--batch_size 128 \
--epochs 200 --lr_m 0.1 --weight_decay 0.0001 \
--log_dir PathForSave --bit_list 2468 --gpu 0
For resnet:
python main_resnet.py --data PathForImageNet \
--visible_gpus '0,1,2,3' --multiprocessing_distributed True \
--dist_url 'tcp://127.0.0.1:23456' --workers 16 \
--arch 'resnet18_quant' --batch_size 256 \
--epochs 90 --lr_m 0.1 --weight_decay 0.0001 \
--log_dir PathForSave --bit_list 2468
or for Mv1:
python main_mv1.py --data PathForImageNet \
--visible_gpus '0,1,2,3' --multiprocessing_distributed True \
--dist_url 'tcp://127.0.0.1:23456' --workers 16 \
--arch 'mv1_quant' --batch_size 256 \
--epochs 90 --lr_m 0.1 --weight_decay 0.0001 \
--log_dir PathForSave --bit_list 2468
1, Open the main_resnet.py
2, Comment lines 25 and 26. Uncomment 27, 28
3, run:
python main_resnet.py --data PathForImageNet \
--visible_gpus '0,1,2,3' --multiprocessing_distributed True \
--dist_url 'tcp://127.0.0.1:23456' --workers 16 \
--arch 'resnet18_quant' --batch_size 256 \
--epochs 90 --lr_m 0.1 --weight_decay 0.0001 \
--log_dir PathForSave --bit_list 234
Code is implemented based on PalQuant. We are very grateful for their excellent work.