sceneReco icon indicating copy to clipboard operation
sceneReco copied to clipboard

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

Open ycp007 opened this issue 7 years ago • 2 comments

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)

ycp007 avatar Nov 02 '17 10:11 ycp007

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

bear63 avatar Nov 03 '17 01:11 bear63

@bear63 thank you,this is ok

liurongfang avatar Apr 29 '18 17:04 liurongfang