pytorch-YOLO-v1 icon indicating copy to clipboard operation
pytorch-YOLO-v1 copied to clipboard

prediction problem

Open vcvishal opened this issue 5 years ago • 3 comments

when i tried to predict this error occurred

load model... predicting... predict.py:143: UserWarning: volatile was removed and now has no effect. Use with torch.no_grad(): instead. img = Variable(img[None,:,:,:],volatile=True) D:\miniconda\lib\site-packages\torch\nn\functional.py:1332: UserWarning: nn.functional.sigmoid is deprecated. Use torch.sigmoid instead. warnings.warn("nn.functional.sigmoid is deprecated. Use torch.sigmoid instead.") Traceback (most recent call last): File "predict.py", line 174, in result = predict_gpu(model,image_name) File "predict.py", line 148, in predict_gpu boxes,cls_indexs,probs = decoder(pred) File "predict.py", line 89, in decoder cls_indexs = torch.cat(cls_indexs,0) #(n,) RuntimeError: zero-dimensional tensor (at position 0) cannot be concatenated

please guide thank you

vcvishal avatar Jun 06 '19 15:06 vcvishal

Hi,I met the same problem,have you solve it?

ChengJianjia avatar Nov 02 '19 04:11 ChengJianjia

@JianJiaCheng Try to use torch.stack() instead.

yahsiuhsieh avatar Nov 24 '19 10:11 yahsiuhsieh

@vcvishal @JianJiaCheng add: cls_indexs = [item.unsqueeze(0) for item in cls_indexs] before : cls_indexs = torch.cat(cls_indexs,0)

TanMeng0 avatar Jun 14 '20 13:06 TanMeng0