PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

使用inference模型预测报错!!!

Open JavieYuan opened this issue 2 years ago • 4 comments

请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem

  • 系统环境/System Environment:
  • 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:
  • 运行指令/Command Code:
  • 完整报错/Complete Error Message: 几个月前拉取的代码,最近训练完后使用python3 tools/export_model.py -c configs/rec/multi_language/premodel_aug3new_4mix.yml -o Global.pretrained_model=./output/rec_mul_premodel_6mix4_train18w/best_accuracy Global.save_inference_dir=./outputmodel/rec_mul_premodel_6mix4_train18w导出模型,显示成功。 然后使用导出的模型进行预测报错,此时命令为python3 tools/infer/predict_rec.py --image_dir="./testdata/test4_mix/photos/6.png" --rec_model_dir="./outputmodel/rec_mul_premodel_6mix4_train18w" --rec_image_shape="3, 32, 320" --rec_char_dict_path="ppocr/utils/dict-7091.txt"

使用的是CRNN+CTC 错误如图: bug

JavieYuan avatar Nov 07 '22 07:11 JavieYuan

可以先排查一下问题: 1)导出模型前能运行预测吗 2)训练代码和导出模型代码都是几个月前的,还是导出模型用的最新的代码?

an1018 avatar Nov 07 '22 08:11 an1018

可以先排查一下问题: 1)导出模型前能运行预测吗 2)训练代码和导出模型代码都是几个月前的,还是导出模型用的最新的代码?

1)导出模型前可以运行infer_rec.py无误 2)训练代码和导出模型代码都是几个月前的,大概7月上旬拉取的整个项目

JavieYuan avatar Nov 07 '22 08:11 JavieYuan

是不是开启tensorrt了呢,可以参考 #7795

an1018 avatar Nov 08 '22 07:11 an1018

是不是开启tensorrt了呢,可以参考 #7795

多谢多谢,确实是这个问题,将infer/utility.py中tensorrt关掉即可。 bug3

JavieYuan avatar Nov 10 '22 02:11 JavieYuan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Jul 08 '23 02:07 github-actions[bot]