当前位置:   article > 正文

UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 6452: illegal multibyte sequence

unicodedecodeerror: 'gbk' codec can't decode byte 0xad in position 645: ille

UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 6452: illegal multibyte sequence


)

  • 出现的问题:
E:\yolov3-keras-master>python convert2keras_weights.py yolov3.cfg yolov3.weights pretrained_weights/yolo.h5
Using TensorFlow backend.
Loading weights.
Weights Header:  0 2 0 [32013312]
Parsing Darknet config.
Traceback (most recent call last):
  File "convert2keras_weights.py", line 263, in <module>
    _main(parser.parse_args())
  File "convert2keras_weights.py", line 84, in _main
    unique_config_file = unique_config_sections(config_path)
  File "convert2keras_weights.py", line 48, in unique_config_sections
    for line in fin:
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 6452: illegal multibyte sequence
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 解决方案:首先,定位到问题出现的位置,再第48行。
  • 出现错误前的代码:
with open(config_file) as fin:
  • 1
  • 修改之后的代码:
with open(config_file,'r', encoding='UTF-8') as fin:
  • 1
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/2023面试高手/article/detail/151110
推荐阅读
相关标签
  

闽ICP备14008679号