predict.py error
czy112 opened this issue · 2 comments
error when i run eval_voc.py
Traceback (most recent call last):
File "eval_voc.py", line 164, in
result = predict_gpu(model,image_path,root_path='E:/yolov1/pytorch_yolov1/data/VOCdevkit/VOC2007/JPEGImages/') #result[[left_up,right_bottom,class_name,image_path],]
File "E:\yolov1\yolores\predict.py", line 126, in predict_gpu
boxes,cls_indexs,probs = decoder(pred)
File "E:\yolov1\yolores\predict.py", line 46, in decoder
if mask[i,j,b] == 1:
IndexError: index 7 is out of bounds for dimension 1 with size 7
当我运行eval_voc.py之后报错上面的问题,请问该如何解决呢?
then i met error:
Traceback (most recent call last):
File "eval_voc.py", line 164, in
result = predict_gpu(model,image_path,root_path='E:/yolov1/pytorch_yolov1/data/VOCdevkit/VOC2007/JPEGImages/') #result[[left_up,right_bottom,class_name,image_path],]
File "E:\yolov1\yolores\predict.py", line 138, in predict_gpu
result.append([(x1,y1),(x2,y2),VOC_CLASSES[cls_index],image_name,prob])
IndexError: string index out of range
I got the same error. You may change the grid_num from 14 to 7 in the decoder function.