yolov3_mobilenetV1训自己数据,训练验证正常,跑eval 和infer却没有效果
Created by: TianyouChen
训练指令: python3 tools/train.py --eval --c ./configs/yolov3_mobilenet_v1_Headshoulder.yml log: EvalReader: batch_size: 8 bufsize: 32 dataset: !VOCDataSet anno_path: test.txt dataset_dir: dataset/voc image_dir: '' label_list: label_list.txt sample_num: -1 use_default_label: true with_background: false drop_empty: false inputs_def: fields: - image - im_size - im_id - gt_bbox - gt_class - is_difficult num_max_boxes: 50 sample_transforms:
- !DecodeImage to_rgb: true with_mixup: false
- !ResizeImage interp: 2 max_size: 0 target_size: 640 use_cv2: true
- !NormalizeImage
is_channel_first: false
is_scale: true
mean:
- 0.485
- 0.456
- 0.406 std:
- 0.229
- 0.224
- 0.225
- !PadBox num_max_boxes: 50
- !Permute channel_first: true to_bgr: false worker_num: 8 LearningRate: [32mbase_lr[0m: 0.001 [32mschedulers[0m:
- !PiecewiseDecay
gamma: 0.1
milestones:
- 8000
- 12000
- 16000 values: null
- !LinearWarmup start_factor: 0.0 steps: 1000 MobileNet: [32mnorm_type[0m: sync_bn conv_group_scale: 1 conv_learning_rate: 1.0 extra_block_filters:
-
- 256
- 512
-
- 128
- 256
-
- 128
- 256
-
- 64
- 128 norm_decay: 0.0 weight_prefix_name: '' with_extra_blocks: false OptimizerBuilder: [32mregularizer[0m: factor: 0.0005 type: L2 optimizer: momentum: 0.9 type: Momentum TestReader: batch_size: 1 dataset: !ImageFolder anno_path: null dataset_dir: '' image_dir: '' sample_num: -1 use_default_label: true with_background: false inputs_def: fields:
- image
- im_size
- im_id image_shape:
- 3
- 640
- 640 sample_transforms:
- !DecodeImage to_rgb: true with_mixup: false
- !ResizeImage interp: 2 max_size: 0 target_size: 640 use_cv2: true
- !NormalizeImage
is_channel_first: false
is_scale: true
mean:
- 0.485
- 0.456
- 0.406 std:
- 0.229
- 0.224
- 0.225
- !Permute channel_first: true to_bgr: false TrainReader: batch_size: 8 batch_transforms:
- !RandomShape
random_inter: true
sizes:
- 320
- 352
- 384
- 416
- 448
- 480
- 512
- 544
- 576
- 640
- !NormalizeImage
is_channel_first: false
is_scale: true
mean:
- 0.485
- 0.456
- 0.406 std:
- 0.229
- 0.224
- 0.225
- !Permute channel_first: true to_bgr: false
- !Gt2YoloTarget
anchor_masks:
-
- 6
- 7
- 8
-
- 3
- 4
- 5
-
- 0
- 1
- 2 anchors:
-
- 10
- 13
-
- 16
- 30
-
- 33
- 23
-
- 30
- 61
-
- 62
- 45
-
- 59
- 119
-
- 116
- 90
-
- 156
- 198
-
- 373
- 326 downsample_ratios:
- 32
- 16
- 8 num_classes: 80 bufsize: 32 dataset: !VOCDataSet anno_path: trainval.txt dataset_dir: dataset/voc image_dir: '' label_list: label_list.txt sample_num: -1 use_default_label: true with_background: false drop_last: true inputs_def: fields:
- image
- gt_bbox
- gt_class
- gt_score num_max_boxes: 50 mixup_epoch: 250 sample_transforms:
-
- !DecodeImage to_rgb: true with_mixup: true
- !MixupImage alpha: 1.5 beta: 1.5
- !ColorDistort
brightness:
- 0.5
- 1.5
- 0.5 contrast:
- 0.5
- 1.5
- 0.5 hue:
- -18
- 18
- 0.5 random_apply: true saturation:
- 0.5
- 1.5
- 0.5
- !RandomExpand
fill_value: !!python/tuple
- 123.675
- 116.28
- 103.53 prob: 0.5 ratio: 4.0
- !RandomCrop
allow_no_crop: true
aspect_ratio:
- 0.5
- 2.0 cover_all_box: false num_attempts: 50 scaling:
- 0.3
- 1.0 thresholds:
- 0.0
- 0.1
- 0.3
- 0.5
- 0.7
- 0.9
- !RandomFlipImage is_mask_flip: false is_normalized: false prob: 0.5
- !NormalizeBox {}
- !PadBox num_max_boxes: 50
- !BboxXYXY2XYWH {} shuffle: true use_process: true worker_num: 8 YOLOv3: [32mbackbone[0m: MobileNet use_fine_grained_loss: false yolo_head: YOLOv3Head YOLOv3Head: [32mnms[0m: background_label: -1 keep_top_k: 100 nms_threshold: 0.45 nms_top_k: 1000 normalized: false score_threshold: 0.01 anchor_masks:
-
- 6
- 7
- 8
-
- 3
- 4
- 5
-
- 0
- 1
- 2 anchors:
-
- 10
- 13
-
- 16
- 30
-
- 33
- 23
-
- 30
- 61
-
- 62
- 45
-
- 59
- 119
-
- 116
- 90
-
- 156
- 198
-
- 373
- 326 block_size: 3 drop_block: false keep_prob: 0.9 norm_decay: 0.0 num_classes: 80 weight_prefix_name: '' yolo_loss: YOLOv3Loss YOLOv3Loss: [32mlabel_smooth[0m: false batch_size: 8 ignore_thresh: 0.7 iou_loss: null use_fine_grained_loss: false architecture: YOLOv3 log_smooth_window: 1 map_type: 11point max_iters: 18000 metric: VOC num_classes: 2 save_dir: output snapshot_iter: 2000 use_gpu: true weights: /home/chenchaocun/PaddleDetection_slim/output/yolov3_mobilenet_v1_Headshoulder
2020-03-24 15:42:13,779-INFO: 1690 samples in file dataset/voc/test.txt 2020-03-24 15:42:13,780-INFO: places would be ommited when DataLoader is not iterable W0324 15:42:14.554183 35746 device_context.cc:237] Please NOTE: device: 0, CUDA Capability: 70, Driver API Version: 10.1, Runtime API Version: 9.0 W0324 15:42:14.558101 35746 device_context.cc:245] device: 0, cuDNN Version: 7.6. 2020-03-24 15:42:16,664-INFO: 1690 samples in file dataset/voc/trainval.txt 2020-03-24 15:42:24,083-INFO: places would be ommited when DataLoader is not iterable I0324 15:42:24.101703 35746 parallel_executor.cc:440] The Program will be executed on CUDA using ParallelExecutor, 2 cards are used, so 2 programs are executed in parallel. I0324 15:42:26.898975 35746 build_strategy.cc:354] set enable_sequential_execution:1 W0324 15:42:26.973911 35746 fuse_all_reduce_op_pass.cc:74] Find all_reduce operators: 147. To make the speed faster, some all_reduce ops are fused during training, after fusion, the number of all_reduce ops is 84. I0324 15:42:26.979429 35746 build_strategy.cc:365] SeqOnlyAllReduceOps:0, num_trainers:1 I0324 15:42:27.174090 35746 parallel_executor.cc:307] Inplace strategy is enabled, when build_strategy.enable_inplace = True I0324 15:42:27.206694 35746 parallel_executor.cc:375] Garbage collection strategy is enabled, when FLAGS_eager_delete_tensor_gb = 0 2020-03-24 15:42:35,910-INFO: iter: 0, lr: 0.000000, 'loss': '15755.842773', time: 0.000, eta: 0:00:01 2020-03-24 15:43:28,829-INFO: iter: 20, lr: 0.000020, 'loss': '233.463013', time: 2.964, eta: 14:48:09 2020-03-24 15:44:20,384-INFO: iter: 40, lr: 0.000040, 'loss': '164.347748', time: 1.452, eta: 7:14:29 2020-03-24 15:45:08,243-INFO: iter: 60, lr: 0.000060, 'loss': '153.642609', time: 2.696, eta: 13:26:04 2020-03-24 15:45:55,259-INFO: iter: 80, lr: 0.000080, 'loss': '126.635468', time: 2.793, eta: 13:54:09 2020-03-24 15:46:45,618-INFO: iter: 100, lr: 0.000100, 'loss': '97.038879', time: 0.186, eta: 0:55:23 2020-03-24 15:48:20,168-INFO: iter: 120, lr: 0.000120, 'loss': '62.637665', time: 2.511, eta: 12:28:12 2020-03-24 15:49:11,236-INFO: iter: 140, lr: 0.000140, 'loss': '96.968536', time: 1.741, eta: 8:38:11 2020-03-24 15:49:18,606-INFO: iter: 160, lr: 0.000160, 'loss': '100.652145', time: 4.316, eta: 21:23:23 2020-03-24 15:50:48,240-INFO: iter: 180, lr: 0.000180, 'loss': '60.300674', time: 2.717, eta: 13:26:54 2020-03-24 15:51:34,845-INFO: iter: 200, lr: 0.000200, 'loss': '74.678650', time: 1.113, eta: 5:30:02 2020-03-24 15:51:45,582-INFO: iter: 220, lr: 0.000220, 'loss': '96.790237', time: 3.995, eta: 19:43:49...... 训练中2000次验证map=56% 将此模型用eval.py跑出来map=0.005 ,跑infer.py 满屏框 box的置信度还很高 0.92~0.99 请问这是啥问题呢?