Closed olgapeled closed 6 years ago
1) try output[i]['n'][0].item() 2) many people succeed voc data evaluations. please refer to https://github.com/marvis/pytorch-yolo2 or marvis/pytorch-yolo3 for detailed procedures. The same procedure can be applied.
I am sorry I am late. I am developed the program in my PC with one GPU. Therefore I did not find the problem. I upgraded the pytorch 0.3 to pytorch 0.4.1. on my linux machine with two GPUs. The case as you pointed is found. I fixed. Thank you for your reporting.
Hi,
First of all, great job!!
Second, I am trying to train on voc data (or even my own data).
Traceback (most recent call last): File "/home/o/workspace/pytorch-0.4-yolov3/train.py", line 350, in
main()
File "/home/o/workspace/pytorch-0.4-yolov3/train.py", line 144, in main
fscore = test(epoch)
File "/home/o/workspace/pytorch-0.4-yolov3/train.py", line 307, in test
all_boxes = get_all_boxes(output, conf_thresh, num_classes, use_cuda=use_cuda)
File "/home/o/workspace/pytorch-0.4-yolov3/utils.py", line 111, in get_all_boxes
pred, anchors, num_anchors = output[i]['x'].data, output[i]['a'], output[i]['n'].item()
ValueError: only one element tensors can be converted to Python scalars
The main problem is here : output[i]['n'].item() because output[i]['n'] contains two values and not only one...
How can I fix it?
Thank You!!!
Olgit