训练自定义数据集出现错误
Created by: renjiechao88
报错信息 File "C:\Users\rjc\Anaconda3\envs\python3\lib\site-packages\yaml\scanner.py", line 116, in check_token self.fetch_more_tokens() File "C:\Users\rjc\Anaconda3\envs\python3\lib\site-packages\yaml\scanner.py", line 162, in fetch_more_tokens self.stale_possible_simple_keys() File "C:\Users\rjc\Anaconda3\envs\python3\lib\site-packages\yaml\scanner.py", line 292, in stale_possible_simple_keys "could not find expected ':'", self.get_mark()) yaml.scanner.ScannerError: while scanning a simple key in "configs\faster_fpn_reader.yml", line 9, column 3 could not find expected ':' in "configs\faster_fpn_reader.yml", line 10, column 5
faster_fpn_reader文件内容 TrainReader: inputs_def: fields: ['image', 'im_info', 'im_id', 'gt_bbox', 'gt_class', 'is_crowd'] dataset:
- !COCODataSet
image_dir: train2017
anno_path: annotations/instances_train2017.json
dataset_dir: dataset/coco
!VOCDataSet dataset_dir: dataset/voc/VOCdevkit anno_path: trainval.txt use_default_label: false sample_transforms:
- !DecodeImage to_rgb: true
- !RandomFlipImage prob: 0.5
- !NormalizeImage is_channel_first: false is_scale: true mean: [0.485,0.456,0.406] std: [0.229, 0.224,0.225]
- !ResizeImage target_size: 800 max_size: 1333 interp: 1 use_cv2: true
- !Permute to_bgr: false channel_first: true batch_transforms:
- !PadBatch pad_to_stride: 32 use_padded_im_info: false batch_size: 1 shuffle: true worker_num: 2 use_process: false
EvalReader: inputs_def:
fields: ['image', 'im_info', 'im_id', 'im_shape']
# for voc
fields: ['image', 'im_info', 'im_id', 'im_shape', 'gt_bbox', 'gt_class', 'is_difficult']
dataset:
!COCODataSet
image_dir: val2017
anno_path: annotations/instances_val2017.json
dataset_dir: dataset/coco
!VOCDataSet dataset_dir: dataset/voc/VOCdevkit anno_path: test.txt use_default_label: false sample_transforms: !DecodeImage to_rgb: true with_mixup: false
- !NormalizeImage is_channel_first: false is_scale: true mean: [0.485,0.456,0.406] std: [0.229, 0.224,0.225]
- !ResizeImage interp: 1 max_size: 1333 target_size: 800 use_cv2: true
- !Permute channel_first: true to_bgr: false batch_transforms:
- !PadBatch pad_to_stride: 32 use_padded_im_info: true batch_size: 1 shuffle: false drop_empty: false worker_num: 2
TestReader: inputs_def: # set image_shape if needed fields: ['image', 'im_info', 'im_id', 'im_shape'] dataset: !ImageFolder anno_path: dataset/voc/VOCdevkit/label_list.txt use_default_label: false sample_transforms:
- !DecodeImage to_rgb: true with_mixup: false
- !NormalizeImage is_channel_first: false is_scale: true mean: [0.485,0.456,0.406] std: [0.229, 0.224,0.225]
- !ResizeImage interp: 1 max_size: 1333 target_size: 800 use_cv2: true
- !Permute channel_first: true to_bgr: false batch_transforms:
- !PadBatch pad_to_stride: 32 use_padded_im_info: true batch_size: 1 shuffle: false