-
AssertionError: Label class 4 exceeds nc=4 in /xxxxxx解決方法
- 原因
- 解決方法:(以我的情況為例)
-
RuntimeError: result type Float can‘t be cast to the desired output type long int
- 原因
- 解決方法
- ImportError: libgthread-2.0.so.0: cannot open shared object file:
-
tensorboard :No dashboards are active for the current data set.
- 問(wèn)題描述
- 解決方法
AssertionError: Label class 4 exceeds nc=4 in /xxxxxx解決方法
原因
一般是由于數(shù)據(jù)集的標(biāo)簽文件出現(xiàn)的類別數(shù)與自己設(shè)置的nc類別數(shù)不符。
例如我原本要檢測(cè)5類目標(biāo),則標(biāo)簽序號(hào)為0、1、2、3、4,nc數(shù)設(shè)置為5,如圖:
而‘4’這一類mAP太低,所以想去掉,于是只把nc數(shù)改為4,所以出現(xiàn)報(bào)錯(cuò)。
解決方法:(以我的情況為例)
方法1.nc數(shù)改為4,再把標(biāo)簽文件里所有‘4’類刪掉;
方法2.還按nc數(shù)為5訓(xùn)練,最后mAP不計(jì)算‘4’類即可。
RuntimeError: result type Float can‘t be cast to the desired output type long int
原因
版本錯(cuò)誤
解決方法
1.打開(kāi)【utils】→【loss.py】;
2.ctrl+f搜索anchors = self.anchors[i]
,將其替換為:anchors, shape = self.anchors[i], p[i].shape
替換效果:
3.ctrl+f搜索indices.append
,將那一行代碼替換為indices.append((b, a, gj.clamp_(0, shape[2] - 1), gi.clamp_(0, shape[3] - 1))) # image, anchor, grid
,替換效果:
4.保存運(yùn)行,問(wèn)題解決。
ImportError: libgthread-2.0.so.0: cannot open shared object file:
控制臺(tái)執(zhí)行兩條命令即可:apt-get update apt-get install libglib2.0-dev
tensorboard :No dashboards are active for the current data set.
問(wèn)題描述
訓(xùn)練過(guò)程中想用tensorboard查看,但在IDE中打不開(kāi),顯示如圖:
自己復(fù)制地址到瀏覽器打開(kāi),干脆變成這樣:
解決方法
找到events文件,我使用的是YOLOv5 6.0,events文件在runs/teain/exp文件夾下,如圖:
當(dāng)然不同的exp如exp、exp2、exp3等等對(duì)應(yīng)了不同的實(shí)驗(yàn),每次實(shí)驗(yàn)都對(duì)應(yīng)一個(gè)或多個(gè)(使用resume的話)events文件,找到你想打開(kāi)的那一個(gè),例如我想查看第二次實(shí)驗(yàn)(即exp2)的數(shù)據(jù),則:文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-651185.html
tensorboard --logdir runs/train/exp2
打開(kāi)彈出的網(wǎng)址即可發(fā)現(xiàn)問(wèn)題解決:
注:本人使用的是云GPU,如果有一樣的朋友需要注意,不能通過(guò)云GPU平臺(tái)的terminal運(yùn)行上述命令,否則還是沒(méi)用。文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-651185.html
到了這里,關(guān)于【YOLOv5】一些不常見(jiàn)的報(bào)錯(cuò)及解決【持續(xù)更新】的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!