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

infer.py出现bug #15

Closed
xdnjust opened this issue Feb 11, 2022 · 2 comments
Closed

infer.py出现bug #15

xdnjust opened this issue Feb 11, 2022 · 2 comments

Comments

@xdnjust
Copy link

xdnjust commented Feb 11, 2022

大佬,我跑你的infer.py文件,出现以下问题,请问是什么原因导致的?

2022-02-11 17:43:53,756 - INFO - ===================Initialize Model Done====================
2022-02-11 17:43:56,841 - INFO - Load INFER Dataset Done, Total eval line: 1200
2022-02-11 17:43:56,843 - INFO - Inference Model...
Inference process: 0%| | 0/1200 [00:00<?, ?batch/s]
Traceback (most recent call last):
File "infer.py", line 150, in
main(parsed_args)
File "infer.py", line 122, in main
inference_speed=args.inference_speed, dump_info_file=args.dump_info_file)
File "infer.py", line 59, in infer_model
inference=True, inference_speed=inference_speed)
File "/home/anaconda3/envs/lcOCR1.4/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/users_2/d00477216/fastbert/model_define/model_fastbert.py", line 477, in forward
labels=labels, training_stage=training_stage)
File "/home/anaconda3/envs/lcOCR1.4/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in call
result = self.forward(*input, **kwargs)
File "/users_2/d00477216/fastbert/model_define/model_fastbert.py", line 393, in forward
uncertain_infos[certain_positions] = uncertain[enough_info]
RuntimeError: shape mismatch: value tensor of shape [0] cannot be broadcast to indexing result of shape [0, 2]

@CaoYiwei
Copy link

#14 (comment)

@xdnjust
Copy link
Author

xdnjust commented Feb 14, 2022

感谢大佬

@xdnjust xdnjust closed this as completed Feb 14, 2022
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

2 participants