Closed LDoubleZhi closed 5 years ago
This is my second time to train yolov3-tiny. At the first time I have not set the --arc and there have no error. But this time if I don't set --arc to uCE or uBCE, the keyerror accured.
When I set --arc to uBCE. The log info like this. Epoch gpu_mem GIoU obj cls total targets img_size 5/99 3.75G 0.403 0.016 0 0.419 38 416: 100%|███████| 19/19 [00:10<00:00, 1.77it/s] Class Images Targets P R mAP F1: 100%|█████████| 5/5 [00:02<00:00, 2.04it/s] all 158 218 0 0 0 0 The P, T,mAP is zero.
There is still a error as
File "/mnt/xfs1/home/liulinzhi/CV/yolov3/utils/utils.py", line 60, in labels_to_class_weights
labels = np.concatenate(labels, 0) # labels.shape = (866643, 5) for COCO
File "<__array_function__ internals>", line 6, in concatenate
ValueError: zero-dimensional arrays cannot be concatenated
@LDoubleZhi you should download the latest with git pull
, or simply start from a fresh git clone
. The repo is constantly changing.
@glenn-jocher Thanks! It works. But I still have a problem. I just write a single img detection function reference the detect.py. The preprocess cost 0.01s (letterbox()), the net cost 0.01s (model(img)), and the postprocess cost 0.004s(nms).so one img maybe cost 0.025s. It seems far from yolov3-tiny's speed.
@glenn-jocher I have to detect every frame come from the camera. The camera's sdk using c++. I should tansfer type mat to numpy, and then feed it in the model. and it seems 25ms per img.
@LDoubleZhi speed comes from batching multiple images together.
@glenn-jocher So it is different from the speed from camera's detection?
@LDoubleZhi we don't have inference speed benchmarks, but you can see in the training speed benchmarks that we can train YOLOv3-SPP (not tiny) at about 115 images per second (416 resolution) on a V100 at batch size 32. Therefore the inference throughput would be some multiple of this value, perhaps twice the speed. https://github.com/ultralytics/yolov3#speed
@LDoubleZhi in any case, the original thread seems to be resolved, so I will close the issue.
Describe the bug Yolov3-tiny get error when traing
To Reproduce Epoch gpu_mem GIoU obj cls total targets img_size 0%| | 0/19 [00:00<?, ?it/s]Traceback (most recent call last): File "train.py", line 416, in
train() # train normally
File "train.py", line 265, in train
loss, loss_items = compute_loss(pred, targets, model)
File "/mnt/xfs1/home/liulinzhi/CV/yolov3-master/utils/utils.py", line 325, in compute_loss
BCEcls = nn.BCEWithLogitsLoss(pos_weight=ft([h['cls_pw']]))
KeyError: 'cls_pw'
0%|