按照训练自定义训练进行操作出现编码问题
Created by: renjiechao88
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 315: illegal multibyte sequence
数据集布置格式: dataset - voc - VOCdevkit //绝对路径 VOCdevkit\VOC2007\JPEGImages\20191115_143546_6.jpg VOCdevkit\VOC2007\Annotations\20191115_143546_6.xml - test.txt -trainval.txt -VOC2007 -Annotations -ImageSets -JPEGImages
修改的faster-fpn-reader.yml 一部分 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 # 是否使用默认标签,默认为true。 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