Closed jhonboHou closed 5 months ago
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
- 系统环境/System Environment:20.04.1-Ubuntu
- 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:ppstructure
- 运行指令/Command Code: design_pic_engine = PPStructure(table=False, ocr=False, show_log=True, use_gpu=False, layout_model_dir='./output_inference/picodet_s_320_coco_lcnet') result = design_pic_engine(img) #这行报错
注:以上是编写的执行自训练的模型文件进行预测,但调用后报先面的错误
- 完整报错/Complete Error Message: Traceback (most recent call last): File "/data/newhome/camera/hzb_test/paddle_test/test_iso_ocr.py", line 11, in result = design_pic_engine(img) File "/home/camera/anaconda3/envs/paddleenv/lib/python3.10/site-packages/paddleocr/paddleocr.py", line 759, in call res, = super().call( File "/home/camera/anaconda3/envs/paddle_env/lib/python3.10/site-packages/paddleocr/ppstructure/predict_system.py", line 112, in call layout_res, elapse = self.layout_predictor(img) File "/home/camera/anaconda3/envs/paddle_env/lib/python3.10/site-packages/paddleocr/ppstructure/layout/predict_layout.py", line 86, in call self.predictor.run() ValueError: (InvalidArgument) The 'shape' attribute in ReshapeOp is invalid. The input tensor X'size must be divisible by known capacity of 'shape'. But received X's shape = [1, 80, 100, 76], X's size = 608000, 'shape' is [-1, 80, 1600], known capacity of 'shape' is -128000. [Hint: Expected output_shape[unk_dim_idx] capacity == -in_size, but received output_shape[unk_dim_idx] capacity:-512000 != -in_size:-608000.] (at ../paddle/fluid/operators/reshape_op.cc:216) [operator < reshape2 > error]
我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):yes
请尽量不要包含图片在问题中/Please try to not include the image in the issue.
使用python tools/infer.py 进行预测没有问题,但是导出模型后,使用就存在上面的异常
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
- 系统环境/System Environment:20.04.1-Ubuntu
- 版本号/Version:Paddle: PaddleOCR: 问题相关组件/Related components:ppstructure
- 运行指令/Command Code: design_pic_engine = PPStructure(table=False, ocr=False, show_log=True, use_gpu=False, layout_model_dir='./output_inference/picodet_s_320_coco_lcnet') result = design_pic_engine(img) #这行报错
注:以上是编写的执行自训练的模型文件进行预测,但调用后报先面的错误
- 完整报错/Complete Error Message: Traceback (most recent call last): File "/data/newhome/camera/hzb_test/paddle_test/test_iso_ocr.py", line 11, in result = design_pic_engine(img) File "/home/camera/anaconda3/envs/paddleenv/lib/python3.10/site-packages/paddleocr/paddleocr.py", line 759, in call res, = super().call( File "/home/camera/anaconda3/envs/paddle_env/lib/python3.10/site-packages/paddleocr/ppstructure/predict_system.py", line 112, in call layout_res, elapse = self.layout_predictor(img) File "/home/camera/anaconda3/envs/paddle_env/lib/python3.10/site-packages/paddleocr/ppstructure/layout/predict_layout.py", line 86, in call self.predictor.run() ValueError: (InvalidArgument) The 'shape' attribute in ReshapeOp is invalid. The input tensor X'size must be divisible by known capacity of 'shape'. But received X's shape = [1, 80, 100, 76], X's size = 608000, 'shape' is [-1, 80, 1600], known capacity of 'shape' is -128000. [Hint: Expected output_shape[unk_dim_idx] capacity == -in_size, but received output_shape[unk_dim_idx] capacity:-512000 != -in_size:-608000.] (at ../paddle/fluid/operators/reshape_op.cc:216) [operator < reshape2 > error]
我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):yes
请尽量不要包含图片在问题中/Please try to not include the image in the issue.
上面问题原因找到了,模型文件用错误了,但是改掉后有报新的粗误了:
Traceback (most recent call last):
File "/data/newhome/camera/hzb_test/paddle_test/test_iso_ocr.py", line 11, in
问题应该是导出的模型的问题,请问下picodet_lcnet_x1_0_fgd_layout_cdla_infer 和picodet_lcnet_x1_0_layout 有什么区别
应该是预测框的大小不匹配导致
问题应该是导出的模型的问题,请问下picodet_lcnet_x1_0_fgd_layout_cdla_infer 和picodet_lcnet_x1_0_layout 有什么区别
cdla是用中文数据集训练的,后面的是用英文数据集
应该是预测框的大小不匹配导致
兄弟我也是迁徙学习的这个模型,在infer.py正常导出到PPStructure就报错: ValueError: (InvalidArgument) The input of Op(Conv) should be a 4-D or 5-D Tensor. But received: input's dimension is 1, input's shape is [0]. [Hint: Expected in_dims.size() == 4 || in_dims.size() == 5 == true, but received in_dims.size() == 4 || in_dims.size() == 5:0 != true:1.] (at ..\paddle\fluid\operators\fused\conv_fusion_op.cc:236) [operator < conv2d_fusion > error] 可以解释一下你发现的问题吗?
应该是预测框的大小不匹配导致
兄弟我也是迁徙学习的这个模型,在infer.py正常导出到PPStructure就报错: ValueError: (InvalidArgument) The input of Op(Conv) should be a 4-D or 5-D Tensor. But received: input's dimension is 1, input's shape is [0]. [Hint: Expected in_dims.size() == 4 || in_dims.size() == 5 == true, but received in_dims.size() == 4 || in_dims.size() == 5:0 != true:1.] (at ..\paddle\fluid\operators\fused\conv_fusion_op.cc:236) [operator < conv2d_fusion > error] 可以解释一下你发现的问题吗?
你这个看信息是维度的问题,传递的应该是4维或5维 但是接收使用的是1维
请提供下述完整信息以便快速定位问题/Please provide the following information to quickly locate the problem
注:以上是编写的执行自训练的模型文件进行预测,但调用后报先面的错误
我们提供了AceIssueSolver来帮助你解答问题,你是否想要它来解答(请填写yes/no)?/We provide AceIssueSolver to solve issues, do you want it? (Please write yes/no):yes
请尽量不要包含图片在问题中/Please try to not include the image in the issue.