梧桐_ 2022-07-19 10:58 采纳率: 50%
浏览 43

YOLOv7在跑时候一直对\n报错

在跑YOLOv7的时候一直在报错“SyntaxError: EOL while scanning string literal”
 logger.info(f'Image sizes {imgsz} train, {imgsz_test} test\n'
                f'Using {dataloader.num_workers} dataloader workers\n'
                f'Logging results to {save_dir}\n'
                f'Starting training for {epochs} epochs...')

运行结果及报错内容
Connected to pydev debugger (build 221.5080.212)
Traceback (most recent call last):
  File "D:\Pycharm\PyCharm 2022.1\plugins\python\helpers\pydev\pydevd.py", line 1491, in _exec
    pydev_imports.execfile(file, globals, locals)  # execute the script
  File "D:\Pycharm\PyCharm 2022.1\plugins\python\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
    exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "E:/YuanMu/yolov7-main/yolov7-main/train.py", line 306
    logger.info(f'Image sizes {imgsz} train, {imgsz_test} test\n'
                                                              ^
SyntaxError: EOL while scanning string literal

Process finished with exit code 1

我的解答思路和尝试过的方法

我用的是当时跑V5的环境,有想过是环境的问题所以重新一个一个pip install了包,还是一样的报错。如果把所有的"\n"删除,后面还继续报错

我想要达到的结果

出于什么原因呢

  • 写回答

2条回答 默认 最新

  • 「已注销」 2022-07-19 10:59
    关注

    报错信息发给我看看

    评论

报告相同问题?

问题事件

  • 创建了问题 7月19日