File tree Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Expand file tree Collapse file tree 2 files changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -272,7 +272,9 @@ cd micronet/compression/quantization/wqaq/iao
272
272
273
273
--weight_observer, weight_observer选择(0-MinMaxObserver, 1-MovingAverageMinMaxObserver)
274
274
275
- - (默认)对称、(权重)通道级量化, bn不融合, weight_observer-MinMaxObserver
275
+ --pretrained_model, 预训练浮点模型
276
+
277
+ - 默认: 对称、(权重)通道级量化, bn不融合, weight_observer-MinMaxObserver, 不加载预训练浮点模型
276
278
277
279
``` bash
278
280
python main.py --q_type 0 --q_level 0 --bn_fuse 0 --weight_observer 0 --gpu_id 0
@@ -415,34 +417,40 @@ python main.py --model_type 1 --gc_prune_refine 154 162 144 304 320 320 608 584
415
417
416
418
##### 剪枝 —> 量化(高位)(剪枝率偏大、量化率偏小)
417
419
418
- - dorefa
420
+ ###### w8a8( dorefa)
419
421
420
422
``` bash
421
423
cd micronet/compression/quantization/wqaq/dorefa
422
424
```
423
425
424
- 或
426
+ - nin(正常卷积结构)
425
427
426
- - iao
428
+ ``` bash
429
+ python main.py --w_bits 8 --a_bits 8 --model_type 0 --prune_refine ../../../pruning/models_save/nin_finetune.pth
430
+ ```
427
431
428
- * 单卡 *
432
+ - nin_gc(含分组卷积结构)
429
433
430
434
``` bash
431
- cd micronet/compression/quantization/wqaq/iao
435
+ python main.py --w_bits 8 --a_bits 8 --model_type 1 --prune_refine ../../../pruning/models_save/nin_gc_retrain.pth
432
436
```
433
437
434
- ###### w8a8
438
+ ###### w8a8(iao)
439
+
440
+ ``` bash
441
+ cd micronet/compression/quantization/wqaq/iao
442
+ ```
435
443
436
444
- nin(正常卷积结构)
437
445
438
446
``` bash
439
- python main.py --w_bits 8 --a_bits 8 --model_type 0 --prune_refine ../../../pruning/models_save/nin_finetune.pth
447
+ python main.py --w_bits 8 --a_bits 8 --model_type 0 --prune_refine ../../../pruning/models_save/nin_finetune.pth --pretrained_model --gpu_id 0
440
448
```
441
449
442
450
- nin_gc(含分组卷积结构)
443
451
444
452
``` bash
445
- python main.py --w_bits 8 --a_bits 8 --model_type 1 --prune_refine ../../../pruning/models_save/nin_gc_retrain.pth
453
+ python main.py --w_bits 8 --a_bits 8 --model_type 1 --prune_refine ../../../pruning/models_save/nin_gc_retrain.pth --pretrained_model --gpu_id 0
446
454
```
447
455
448
456
###### 其他可选量化配置类比
Original file line number Diff line number Diff line change 1
- __version__ = "1.7.1 "
1
+ __version__ = "1.7.2 "
2
2
3
3
def quant_test_manual ():
4
4
import torch .nn as nn
You can’t perform that action at this time.
0 commit comments