-
前言 我们在搭建yolo系列目标检测模型时,往往需要对代码进行逐步调试,及时发现错误,所以本文在pycharm的基础上,对yolov6中的infer.py进行逐步调试。 -
首先我们在conda环境一切准备就绪的情况下,能在终端tenminal中跑通infer.py,需要在tenminal中输入以下指令:
python tools/infer.py --weights weights/yolov6s.pt --source test_img/30%.jpeg --save-txt
可以看到,后面有“–weights”等参数,如果我们直接run的话,程序只能够按默认参数配置进行运行,所以我们为了能够对程序进行DeBug,我们首先能够要将参数配置好。 首先第一步:点击鼠标右键,找到“Modify Run Configuration”这一项,  点击进入,会看到以下界面,
 在“Parameters”参数栏中,填入以下参数配置,填入后,如下:  !!注意注意!!,看到以上的“Working directory”中的工作空间,一定要修改为“weights/yolov6s.pt”该相对路径的上一级目录,也就是yolov6,如下所示:  最后一定要点"apply",然后再点击“OK”。
3.调试(Debug) 再选择Debug,  点击后,如图所示:  已经可以开始逐步调试,么有报错。
4.逐步调试 关于打断点,逐步调试,建议参考下面这篇文章,希望能够帮到你,祝你一切顺利!
https://blog.csdn.net/weixin_43499626/article/details/117222955
|