yolo3-pytorch icon indicating copy to clipboard operation
yolo3-pytorch copied to clipboard

分类可以设置为空吗?

Open ma062304 opened this issue 3 years ago • 3 comments

我的实际运用不需要输出种类,可以把model_data中的coco classes和voc classes里的分类清空吗?

ma062304 avatar Dec 07 '21 06:12 ma062304

分类文件夹清空后预测显示这个: D:\anaconda\python.exe D:/abc/yolo1/predict.py logs/ep100-loss0.003-val_loss0.003.pth model, anchors, and classes loaded. Input image filename:D:\abc\yolo1\VOCdevkit\VOC2007\JPEGImages\000039.JPG Traceback (most recent call last): File "D:/abc/yolo1/predict.py", line 65, in r_image = yolo.detect_image(image) File "D:\abc\yolo1\yolo.py", line 136, in detect_image outputs = self.bbox_util.decode_box(outputs) File "D:\abc\yolo1\utils\utils_bbox.py", line 109, in decode_box conf.view(batch_size, -1, 1), pred_cls.view(batch_size, -1, self.num_classes)), -1) RuntimeError: cannot reshape tensor of 0 elements into shape [1, -1, 0] because the unspecified dimension size -1 can be any value and is ambiguous

ma062304 avatar Dec 07 '21 07:12 ma062304

不可以清空……我建议你看看代码再去掉种类吧

bubbliiiing avatar Dec 07 '21 15:12 bubbliiiing

看看预测过程的代码

bubbliiiing avatar Dec 07 '21 15:12 bubbliiiing