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:

猜你喜欢

转载自blog.csdn.net/qq_26938321/article/details/129023091