YOLOv5中‘utf-8‘ codec can‘t decode编码问题

YOLOv5中’utf-8’ codec can’t decode编码问题
在YOLOv5中出现’utf-8’ codec can’t decode错误,

(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd3 in position 357: invalid continuation byte

在…/yolov5-master/train.py

with open(opt.hyp) as f:

改为:

with open(opt.hyp, encoding='gb2312') as f:

增加encoding='gb2312’编码项
或者

# with open(opt.hyp) as f:
with open(opt.hyp, encoding='gb2312') as f:

你可能感兴趣的:(YOLO,YOLO,深度学习,人工智能)