Q :运行Val.py时如下报错:

AssertionError: ..\..\best.pt (2 classes) trained on different --data than what you passed (80 classes). Pass correct combination of --weights and --data that are trained together.

 S:在yolov5s.yaml下检查 nc 分类是否与自己的数据集分类吻合。

源代码下默认 nc = 80

此处我的数据集分为两类,则改为 nc = 2

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐