YOLOv3 output layer number not equal target number
Created by: joshuazm
/opt/anaconda3/bin/anaconda/lib/python3.7/site-packages/sklearn/feature_extraction/text.py:17: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
from collections import Mapping, defaultdict
EvalReader:
batch_size: 32
bufsize: 32
dataset: !COCODataSet
anno_path: dx_val.json
dataset_dir: dataset/dx
image_dir: images/val2020
sample_num: -1
with_background: false
drop_empty: false
inputs_def:
fields:
- image
- im_size
- im_id
image_shape:
- 3
- 608
- 608
num_max_boxes: 50
sample_transforms:
- !DecodeImage
to_rgb: true
with_mixup: false
- !ResizeImage
interp: 2
max_size: 0
target_size: 608
use_cv2: true
- !NormalizeImage
is_channel_first: false
is_scale: false
mean:
- 0.485
- 0.456
- 0.406
std:
- 0.229
- 0.224
- 0.225
- !Permute
channel_first: true
to_bgr: false
worker_num: 8
IouLoss:
loss_weight: 2.5
max_height: 608
max_width: 608
LearningRate:
[32mbase_lr[0m: 0.0001
[32mschedulers[0m:
- !PiecewiseDecay
gamma: 0.1
milestones:
- 55000
- 75000
values: null
- !LinearWarmup
start_factor: 0.0
steps: 4000
OptimizerBuilder:
[32mregularizer[0m:
factor: 0.0005
type: L2
optimizer:
momentum: 0.9
type: Momentum
ResNet:
[32mdcn_v2_stages[0m:
- 5
[32mfeature_maps[0m:
- 3
- 4
- 5
[32mfreeze_at[0m: 0
[32mfreeze_norm[0m: false
[32mnorm_type[0m: sync_bn
[32mvariant[0m: d
depth: 50
gcb_params: {}
gcb_stages: []
nonlocal_stages: []
norm_decay: 0.0
weight_prefix_name: ''
TrainReader:
batch_size: 16
batch_transforms:
- !RandomShape
random_inter: true
sizes:
- 320
- 352
- 384
- 416
- 448
- 480
- 512
- 544
- 576
- 608
- !NormalizeImage
is_channel_first: false
is_scale: false
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: !COCODataSet
anno_path: dx_train.json
dataset_dir: dataset/dx
image_dir: images/train2020
sample_num: -1
with_background: false
drop_last: true
inputs_def:
fields:
- image
- gt_bbox
- gt_class
- gt_score
num_max_boxes: 50
sample_transforms:
- !DecodeImage
to_rgb: true
with_mixup: false
- !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: false
use_fine_grained_loss: true
use_process: true
worker_num: 8
YOLOv3:
[32mbackbone[0m: ResNet
[32muse_fine_grained_loss[0m: false
yolo_head: YOLOv3Head
YOLOv3Head:
[32mdrop_block[0m: true
[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
keep_prob: 0.9
norm_decay: 0.0
num_classes: 80
weight_prefix_name: ''
yolo_loss: YOLOv3Loss
YOLOv3Loss:
[32mbatch_size[0m: 16
[32miou_loss[0m: IouLoss
[32mlabel_smooth[0m: false
[32muse_fine_grained_loss[0m: true
ignore_thresh: 0.7
architecture: YOLOv3
log_smooth_window: 20
max_iters: 85000
metric: COCO
num_classes: 1
pretrain_weights: https://paddlemodels.bj.bcebos.com/object_detection/ResNet50_vd_dcn_db_obj365_pretrained.tar
save_dir: output
snapshot_iter: 200
use_fine_grained_loss: true
use_gpu: true
weights: output/yolov3_r50vd_dcn_db_iouloss_obj365_pretrained_coco/model_final
Traceback (most recent call last):
File "tools/train.py", line 323, in <module>
main()
File "tools/train.py", line 116, in main
train_fetches = model.train(feed_vars)
File "/mnt/PaddleDetection/ppdet/modeling/architectures/yolov3.py", line 156, in train
return self.build(feed_vars, mode='train')
File "/mnt/PaddleDetection/ppdet/modeling/architectures/yolov3.py", line 85, in build
gt_score, targets)
File "/mnt/PaddleDetection/ppdet/modeling/anchor_heads/yolo_head.py", line 277, in get_loss
self.prefix_name)
File "/mnt/PaddleDetection/ppdet/modeling/losses/yolo_loss.py", line 57, in __call__
mask_anchors, self._ignore_thresh)
File "/mnt/PaddleDetection/ppdet/modeling/losses/yolo_loss.py", line 107, in _get_fine_grained_loss
"YOLOv3 output layer number not equal target number"
AssertionError: YOLOv3 output layer number not equal target number
我是想用来训练自己的数据,且只有一个类