Closed zengtao1978 closed 1 year ago
动态模型在ai studio 上,利用: python tools/infer.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml --infer_img=./output/images_00001.png --output_dir=infer_output/ -o weights=./output/ppyolov2_r50vd_dcn_365e_coco/best_model 是能够输出正常结果的。
可以转到PaddleOCR下去提问
已转
问题描述 Please describe your issue
1.paddleocr版本2.6.0 paddleDetection版本2.5.0 2.下载CDLA中文数据集在ai studio中利用:ppyolov2_r50vd_dcn_365e_coco.yml 训练。 3.训练生成best_model.pdparams 利用脚本: python tools/export_model.py -c configs/ppyolo/ppyolov2_r50vd_dcn_365e_coco.yml --output_dir=./inference_model 导出成model.pdiparams 和 model.pdmodel 静态文件。 4.利用layoutparser(https://paddleocr.bj.bcebos.com/whl/layoutparser-0.0.0-py3-none-any.whl) 能正常输出结构信息。 代码片段,参考: https://aistudio.baidu.com/aistudio/projectdetail/2274897 model = lp.PaddleDetectionLayoutModel(model_path="./checkpoint", threshold=0.5, label_map={1: "Text", 2: "Title", 3: "Figure", 4: "Figure caption", 5: "Table", 6: "Table caption", 7: "Header", 8: "Footer", 9: "Reference", 10: "Equation"}, enforce_cpu=True, enable_mkldnn=False)
检测
5.利用PPStructure运行报错误: 代码片段,参考: https://aistudio.baidu.com/aistudio/projectdetail/2274897 table_engine = PPStructure(show_log=True, lang='ch', table=False, layout_model_dir="./checkpoint") files = os.listdir(img_dir) for fi in files:
找到文件对应子目录
异常信息: File "/Users/zengtao/projects/asdc/ocr-helper/venv/lib/python3.9/site-packages/paddleocr/paddleocr.py", line 605, in call res, _ = super().call( File "/Users/zengtao/projects/asdc/ocr-helper/venv/lib/python3.9/site-packages/paddleocr/ppstructure/predict_system.py", line 109, in call layout_res, elapse = self.layout_predictor(img) File "/Users/zengtao/projects/asdc/ocr-helper/venv/lib/python3.9/site-packages/paddleocr/ppstructure/layout/predict_layout.py", line 86, in call self.predictor.run() ValueError: (InvalidArgument) The conv2d Op's Input Variable
Input
contains uninitialized Tensor. [Hint: Expected t->IsInitialized() == true, but received t->IsInitialized():0 != true:1.] (at /home/Paddle/paddle/fluid/framework/operator.cc:2411) [operator < conv2d > error]帮忙分析一下原因,谢谢。