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

run captcha_predict.py got an error after change the png photo in predict #38

Open
jamesfyp opened this issue Sep 29, 2020 · 0 comments

Comments

@jamesfyp
Copy link

Traceback (most recent call last):
File "/Users/james/pythonproject/pytorch-captcha-recognition/captcha_predict.py", line 34, in
main()
File "/Users/james/pythonproject/pytorch-captcha-recognition/captcha_predict.py", line 19, in main
for i, (images, labels) in enumerate(predict_dataloader):
File "/Users/james/pythonproject/airasiago/venv/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 345, in next
data = self._next_data()
File "/Users/james/pythonproject/airasiago/venv/lib/python2.7/site-packages/torch/utils/data/dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/Users/james/pythonproject/airasiago/venv/lib/python2.7/site-packages/torch/utils/data/utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/Users/james/pythonproject/pytorch-captcha-recognition/my_dataset.py", line 24, in getitem
label = ohe.encode(image_name.split('
')[0]) # 为了方便,在生成图片的时候,图片文件的命名格式 "4个数字或者数字_时间戳.PNG", 4个字母或者即是图片的验证码的值,字母大写,同时对该值做 one-hot 处理
File "/Users/james/pythonproject/pytorch-captcha-recognition/one_hot_encoding.py", line 22, in encode
vector[idx] = 1.0
IndexError: index 152 is out of bounds for axis 0 with size 144

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

1 participant