evaluation
The batchsize of eval.py must be 1?
Same problem, trying to solve with larger batch size.
@zmonoid would you mind sharing your solution?
@Jumabek Yes, basically, it is like:
for i, (inputs, box_targets, label_targets) in enumerate(dataloader):
print('%d/%d' % (i, len(dataloader)))
loc_preds, cls_preds = net(Variable(inputs.cuda(), volatile=True))
for j in range(inputs.size(0)):
gt_boxes.append(box_targets[j])
gt_labels.append(label_targets[j])
box_preds, label_preds, score_preds = box_coder.decode(
loc_preds[j].cpu().data.squeeze(),
F.softmax(cls_preds[j].squeeze(), dim=1).cpu().data,
score_thresh=0.01)
pred_boxes.append(box_preds)
pred_labels.append(label_preds)
pred_scores.append(score_preds)
Still it is very slow. Main time consumption is at box_coder.decode.
Thanks I changed box decoding to gpu and got improvement from 17sec to 7 sec for single image
On Thu, May 31, 2018, 7:13 PM ZHOU Bin [email protected] wrote:
@Jumabek https://github.com/Jumabek Yes, basically, it is like:
for i, (inputs, box_targets, label_targets) in enumerate(dataloader): print('%d/%d' % (i, len(dataloader))) loc_preds, cls_preds = net(Variable(inputs.cuda(), volatile=True))
for j in range(inputs.size(0)): gt_boxes.append(box_targets[j]) gt_labels.append(label_targets[j]) box_preds, label_preds, score_preds = box_coder.decode( loc_preds[j].cpu().data.squeeze(), F.softmax(cls_preds[j].squeeze(), dim=1).cpu().data, score_thresh=0.01) pred_boxes.append(box_preds) pred_labels.append(label_preds) pred_scores.append(score_preds)Still it is very slow. Main time consumption is at box_coder.decode.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kuangliu/torchcv/issues/14#issuecomment-393483892, or mute the thread https://github.com/notifications/unsubscribe-auth/AEJIQa62FDSz19b0CcDjiyOOju7re_psks5t38ItgaJpZM4SiGcI .
you might find https://github.com/kuangliu/torchcv/issues/29 informative
Speed is a lot faster when I am evaluating later models like after 300K iter
@Jumabek can u share the gpu implementation?
I'm always getting this:
RuntimeError: Expected object of type torch.cuda.FloatTensor but found type torch.FloatTensor for argument #2 'other'
Is this because my other variables are in CPU?
Update:
Figured it out. But still is very slow
Why is the score threshold kept very low?? The VOC function needs all the generated boxes? The decoding is very fast when the threshold is high