前言:Hello大家好,我是小哥谈。《YOLOv8:从入门到实战》专栏上线后,部分同学在学习过程中提出了一些问题,笔者相信这些问题其他同学也有可能遇到。为了让大家可以更好地学习本专栏内容,笔者特意推出了该篇专栏答疑,针对同学们在学习过程中所提出的问题进行汇总记录,并不断实时更新,希望能够帮助到大家!🌈
目录
🚀1.报错解决
🍀🍀报错1
🍀🍀报错2
🚀2.专栏答疑
🚀1.报错解决
🍀🍀报错1
报错内容:
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
具体如下图所示:
解决方案:
通常情况下,在linux系统中可以使用多个子进程加载数据,而在windows系统中不能。在windows系统中需要将进程数设置为单进程,所以我们需要将default.yaml文件中的参数workers设置为0,即可解决此报错问题。这种方式的缺陷是改为采用单进程加载,速度会变慢。
default.yaml文件位置位于ultralytics/cfg中,具体如下图所示:
🍀🍀报错2
报错内容:
AttributeError: 'FreeTypeFont' object has no attribute 'getsize'
解决方案:
原因与解决方案:pillow版本问题,最新的10.0版本会产生上述问题,降低pillow版本为9.5。
可以尝试以下方法进行解决:
pip install Pillow==9.5
🚀2.专栏答疑
说明:♨️♨️♨️
本篇内容笔者会根据情况实时更新,大家有任何问题欢迎指出!~ 🍉 🍓 🍑 🍈 🍌 🍐