Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prediction problem #25

Open
vcvishal opened this issue Jun 6, 2019 · 3 comments
Open

prediction problem #25

vcvishal opened this issue Jun 6, 2019 · 3 comments

Comments

@vcvishal
Copy link

vcvishal commented Jun 6, 2019

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

@ChengJianjia
Copy link

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

@yahsiuhsieh
Copy link

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

@TanMeng0
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants