当前位置:   article > 正文

YOLOv7报错UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0x80 in position 234: illegal multibyte se_yolov7 'gbk' codec can't decode byte 0x80 in posit

yolov7 'gbk' codec can't decode byte 0x80 in position 234: illegal multibyte

  File "C:\Users\jun\.conda\envs\yolov7\lib\site-packages\yaml\loader.py", line 34, in __init__
    Reader.__init__(self, stream)
  File "C:\Users\jun\.conda\envs\yolov7\lib\site-packages\yaml\reader.py", line 85, in __init__
    self.determine_encoding()
  File "C:\Users\jun\.conda\envs\yolov7\lib\site-packages\yaml\reader.py", line 124, in determine_encoding
    self.update_raw()
  File "C:\Users\jun\.conda\envs\yolov7\lib\site-packages\yaml\reader.py", line 178, in update_raw
    data = self.stream.read(size)
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 234: illegal multibyte sequence

在运行文件中搜索,with open,添加encoding='utf-8'

if isinstance(data, str):
is_coco = data.endswith('coco.yaml')
with open(data,encoding='utf-8') as f:
data = yaml.load(f, Loader=yaml.SafeLoader)

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/凡人多烦事01/article/detail/151076
推荐阅读
相关标签
  

闽ICP备14008679号