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

RuntimeError: dimension out of range (expected to be in range of [-2, 1], but got 2) #24

Open
ycp007 opened this issue Nov 2, 2017 · 2 comments

Comments

@ycp007
Copy link

ycp007 commented Nov 2, 2017

When I input 21.bmp, I got an error:
please input file name:21.bmp
Traceback (most recent call last):
File "demo.py", line 23, in
crnnRec(model,converter,img,text_recs)
File "/home/ycp/sceneReco-master/crnnport.py", line 78, in crnnRec
preds = preds.squeeze(2)
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/variable.py", line 750, in squeeze
return Squeeze.apply(self, dim)
File "/usr/local/lib/python2.7/dist-packages/torch/autograd/_functions/tensor.py", line 378, in forward
result = input.squeeze(dim)
RuntimeError: dimension out of range (expected to be in range of [-2, 1], but got 2)

@bear63
Copy link
Owner

bear63 commented Nov 3, 2017

#preds = preds.squeeze(2)
delete preds = preds.squeeze(2) I also encountered this problem on different computers

@liurongfang
Copy link

@bear63 thank you,this is ok

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

3 participants