@@ -383,7 +383,7 @@ def test_post_training_hist_mobilenetv1(self):
383
383
is_full_quantize = False
384
384
is_use_cache_file = False
385
385
is_optimize_model = True
386
- diff_threshold = 0.025
386
+ diff_threshold = 0.03
387
387
self .run_test (model , algo , round_type , data_urls , data_md5s ,
388
388
quantizable_op_type , is_full_quantize , is_use_cache_file ,
389
389
is_optimize_model , diff_threshold )
@@ -412,123 +412,6 @@ def test_post_training_abs_max_mobilenetv1(self):
412
412
is_optimize_model , diff_threshold )
413
413
414
414
415
- class TestPostTrainingAvgAdaRoundForMobilenetv1 (TestPostTrainingQuantization ):
416
- def test_post_training_adaround_mobilenetv1 (self ):
417
- model = "MobileNet-V1"
418
- algo = "avg"
419
- round_type = "adaround"
420
- data_urls = [
421
- 'http://paddle-inference-dist.bj.bcebos.com/int8/mobilenetv1_int8_model.tar.gz'
422
- ]
423
- data_md5s = ['13892b0716d26443a8cdea15b3c6438b' ]
424
- quantizable_op_type = [
425
- "conv2d" ,
426
- "depthwise_conv2d" ,
427
- "mul" ,
428
- ]
429
- is_full_quantize = False
430
- is_use_cache_file = False
431
- is_optimize_model = True
432
- diff_threshold = 0.025
433
- self .run_test (model , algo , round_type , data_urls , data_md5s ,
434
- quantizable_op_type , is_full_quantize , is_use_cache_file ,
435
- is_optimize_model , diff_threshold )
436
-
437
-
438
- class TestPostTrainingAbsMaxAdaRoundForMobilenetv1 (
439
- TestPostTrainingQuantization ):
440
- def test_post_training_adaround_mobilenetv1 (self ):
441
- model = "MobileNet-V1"
442
- algo = "abs_max"
443
- round_type = "adaround"
444
- data_urls = [
445
- 'http://paddle-inference-dist.bj.bcebos.com/int8/mobilenetv1_int8_model.tar.gz'
446
- ]
447
- data_md5s = ['13892b0716d26443a8cdea15b3c6438b' ]
448
- quantizable_op_type = [
449
- "conv2d" ,
450
- "depthwise_conv2d" ,
451
- "mul" ,
452
- ]
453
- is_full_quantize = False
454
- is_use_cache_file = False
455
- is_optimize_model = True
456
- diff_threshold = 0.025
457
- self .run_test (model , algo , round_type , data_urls , data_md5s ,
458
- quantizable_op_type , is_full_quantize , is_use_cache_file ,
459
- is_optimize_model , diff_threshold )
460
-
461
-
462
- class TestPostTraininghistAdaroundForMobilenetv1 (TestPostTrainingQuantization ):
463
- def test_post_training_hist_mobilenetv1 (self ):
464
- model = "MobileNet-V1"
465
- algo = "hist"
466
- round_type = "adaround"
467
- data_urls = [
468
- 'http://paddle-inference-dist.bj.bcebos.com/int8/mobilenetv1_int8_model.tar.gz'
469
- ]
470
- data_md5s = ['13892b0716d26443a8cdea15b3c6438b' ]
471
- quantizable_op_type = [
472
- "conv2d" ,
473
- "depthwise_conv2d" ,
474
- "mul" ,
475
- ]
476
- is_full_quantize = False
477
- is_use_cache_file = False
478
- is_optimize_model = True
479
- diff_threshold = 0.025
480
- self .run_test (model , algo , round_type , data_urls , data_md5s ,
481
- quantizable_op_type , is_full_quantize , is_use_cache_file ,
482
- is_optimize_model , diff_threshold )
483
-
484
-
485
- class TestPostTrainingKLAdaroundForMobilenetv1 (TestPostTrainingQuantization ):
486
- def test_post_training_kl_mobilenetv1 (self ):
487
- model = "MobileNet-V1"
488
- algo = "KL"
489
- round_type = "adaround"
490
- data_urls = [
491
- 'http://paddle-inference-dist.bj.bcebos.com/int8/mobilenetv1_int8_model.tar.gz'
492
- ]
493
- data_md5s = ['13892b0716d26443a8cdea15b3c6438b' ]
494
- quantizable_op_type = [
495
- "conv2d" ,
496
- "depthwise_conv2d" ,
497
- "mul" ,
498
- "pool2d" ,
499
- ]
500
- is_full_quantize = False
501
- is_use_cache_file = False
502
- is_optimize_model = True
503
- diff_threshold = 0.025
504
- self .run_test (model , algo , round_type , data_urls , data_md5s ,
505
- quantizable_op_type , is_full_quantize , is_use_cache_file ,
506
- is_optimize_model , diff_threshold )
507
-
508
-
509
- class TestPostTrainingEMDForMobilenetv1 (TestPostTrainingQuantization ):
510
- def test_post_training_avg_mobilenetv1 (self ):
511
- model = "MobileNet-V1"
512
- algo = "emd"
513
- round_type = "round"
514
- data_urls = [
515
- 'http://paddle-inference-dist.bj.bcebos.com/int8/mobilenetv1_int8_model.tar.gz'
516
- ]
517
- data_md5s = ['13892b0716d26443a8cdea15b3c6438b' ]
518
- quantizable_op_type = [
519
- "conv2d" ,
520
- "depthwise_conv2d" ,
521
- "mul" ,
522
- ]
523
- is_full_quantize = False
524
- is_use_cache_file = False
525
- is_optimize_model = True
526
- diff_threshold = 0.025
527
- self .run_test (model , algo , round_type , data_urls , data_md5s ,
528
- quantizable_op_type , is_full_quantize , is_use_cache_file ,
529
- is_optimize_model , diff_threshold )
530
-
531
-
532
415
class TestPostTrainingAvgONNXFormatForMobilenetv1 (TestPostTrainingQuantization ):
533
416
def test_post_training_onnx_format_mobilenetv1 (self ):
534
417
model = "MobileNet-V1"
0 commit comments