YOLOv8 bug debugging and configuration files


This article is only used for some personal records of bugs, not the teaching of yolov8, so it is not a guide to run through the code from 0.

affirm

This article is only used for some personal records of bugs, not the teaching of yolov8, so it is not a guide to run through the code from 0.

UnicodeEncodeError: ‘gbk’ codec can’t encode character ‘\u03aa’ in position 3: illegal multibyte sequence

Solution:
point to yolo/utils/–init–.py under the project path, and find the 279th line of code:

    # Dump data to file in YAML format
    with open(file, 'w',) as f:
        yaml.safe_dump(data, f, sort_keys=False, allow_unicode=True)

Change it to:

    # Dump data to file in YAML format
    with open(file, 'w', encoding="gbk", errors='ignore') as f:
        yaml.safe_dump(data, f, sort_keys=False, allow_unicode=True)

Modification of save path of model weight

Solution:
Line 92 under ultralytics/yolo/engine/trainer.py:

 # Dirs
        project = self.args.project or Path(SETTINGS['runs_dir']) / self.args.task
        # project = "D:\\Ultralytics\\runs\\segment"
        name = self.args.name or f'{
      
      self.args.mode}'

Change it to:

# Dirs
        # project = self.args.project or Path(SETTINGS['runs_dir']) / self.args.task
        project = "D:\\Ultralytics\\runs\\segment"
        name = self.args.name or f'{
      
      self.args.mode}'

You can specify the path to save the model weights after training.

Guess you like

Origin blog.csdn.net/ycx_ccc/article/details/131847461