andy-yun / pytorch-0.4-yolov3

Yet Another Implimentation of Pytroch 0.4.1 and YoloV3 on python3
MIT License
279 stars 72 forks source link

Error when validating model in VOC #5

Closed xsingit closed 6 years ago

xsingit commented 6 years ago

Hello, thanks for the script. The train.py code are working great. However, when I do the following command to evaluate model in VOC: python valid.py cfg/voc.data cfg/yolo-voc.cfg backup/000002.weights python scripts/voc_eval.py results/comp4_dettest I got a error: Traceback (most recent call last): File "scripts/voc_eval.py", line 265, in _do_python_eval(res_prefix, output_dir = 'output') File "scripts/voc_eval.py", line 241, in _do_python_eval use_07_metric=use_07_metric) File "scripts/voc_eval.py", line 149, in voc_eval BB = BB[sorted_ind, :] IndexError: too many indices for array "save_interval" is set to 2, and 000002.weights is a trained model weight file. I find all generated comp4_dettest* file sizes in the /results directory are 0 Bytes. By looking at the valid.py and utils.py files and printing the results of the variables, I guess that because the conf values are all less than the conf_thresh, the following code has not been executed,, if conf > conf_thresh:(line 174, in utils.py) bcx = xs[ind] bcy = ys[ind] bw = ws[ind] bh = hs[ind] ... I want to know what went wrong and what should i do... Any suggestion will be appreciated! Thanks.

andy-yun commented 6 years ago

I am sorry that it bothers you. Actually, after the modification of the previous script working on python 3 + pytorch 0.3, I didn’t verify the validation. I will check and modify the script as soon as possible.

andy-yun commented 6 years ago

One more thing, did you trained the model with yolov2? yolo-voc.cfg is config file for yolov2 model. And 000002.weights may be too small iterated training weights file by guessing the epoch number based on filename. Anyway, I will check the scripts/voceval.py. ^^

xsingit commented 6 years ago

Thank you very much for your reply. I trained the model with yolov3 and i'm so sorry that I used the configuration file incorrectly. When I do the following command:

python train.py -d cfg/voc.data -c cfg/yolo_v3.cfg -w yolov3.weights -r python valid.py cfg/voc.data cfg/yolo_v3.cfg backup/000020.weights python scripts/voc_eval.py results/comp4_dettest

No error occurred and working great. Sorry for the inconvenience. Thanks.

andy-yun commented 6 years ago

Good. You're welcome.