Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • PaddleOCR
  • Issue
  • #748

P
PaddleOCR
  • 项目概览

PaddlePaddle / PaddleOCR
大约 2 年 前同步成功

通知 1557
Star 32965
Fork 6643
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 108
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 7
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
PaddleOCR
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 108
    • Issue 108
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 7
    • 合并请求 7
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板
已关闭
开放中
Opened 9月 18, 2020 by saxon_zh@saxon_zhGuest

SRN推理错误

Created by: YasinZhao

python3 tools/infer/predict_rec.py --image_dir="./doc/imgs_words_en/word_336.png" --rec_model_dir="./inference/srn/" --rec_image_shape="3, 32, 100" --rec_char_type="en" --rec_algorithm="SRN"


C++ Call Stacks (More useful to developers):

0 std::string paddle::platform::GetTraceBackString<std::string const&>(std::string const&, char const*, int) 1 paddle::platform::EnforceNotMet::EnforceNotMet(std::string const&, char const*, int) 2 paddle::operators::ReshapeOp::ValidateShape(std::vector<int, std::allocator >, paddle::framework::DDim const&) 3 paddle::operators::ReshapeOp::InferShape(paddle::framework::InferShapeContext*) const 4 paddle::operators::Reshape2Op::InferShape(paddle::framework::InferShapeContext*) const 5 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&, paddle::framework::RuntimeContext*) const 6 paddle::framework::OperatorWithKernel::RunImpl(paddle::framework::Scope const&, paddle::platform::Place const&) const 7 paddle::framework::OperatorBase::Run(paddle::framework::Scope const&, paddle::platform::Place const&) 8 paddle::framework::NaiveExecutor::Run() 9 paddle::AnalysisPredictor::Run(std::vector<paddle::PaddleTensor, std::allocatorpaddle::PaddleTensor > const&, std::vector<paddle::PaddleTensor, std::allocatorpaddle::PaddleTensor >*, int)


Python Call Stacks (More useful to users):

File "/root/miniconda3/envs/face_detect/lib/python3.6/site-packages/paddle/fluid/framework.py", line 2610, in append_op attrs=kwargs.get("attrs", None)) File "/root/miniconda3/envs/face_detect/lib/python3.6/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(*args, **kwargs) File "/root/miniconda3/envs/face_detect/lib/python3.6/site-packages/paddle/fluid/layers/nn.py", line 7440, in reshape "XShape": x_shape}) File "/app/ocr/PaddleOCR-0918/ppocr/modeling/heads/rec_srn_all_head.py", line 44, in pvam conv_features = fluid.layers.reshape(x=inputs, shape=[-1, c, h * w]) File "/app/ocr/PaddleOCR-0918/ppocr/modeling/heads/rec_srn_all_head.py", line 218, in call pvam_features = self.pvam(inputs, others) File "/app/ocr/PaddleOCR-0918/ppocr/modeling/architectures/rec_model.py", line 193, in call predicts = self.head(conv_feas, labels, mode) File "/app/ocr/PaddleOCR-0918/tools/program.py", line 214, in build_export image, others, outputs = model(mode='export') File "tools/export_model.py", line 51, in main config, eval_program, startup_prog) File "tools/export_model.py", line 75, in main()


Error Message Summary:

InvalidArgumentError: 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, 512, 4, 13], X's size = 26624, 'shape' is [-1, 512, 256], known capacity of 'shape' is -131072. [Hint: Expected output_shape[unk_dim_idx] * capacity == -in_size, but received output_shape[unk_dim_idx] * capacity:0 != -in_size:-26624.] at (/paddle/paddle/fluid/operators/reshape_op.cc:192) [operator < reshape2 > error] 2020-09-18 16:58:06,739-INFO: ERROR!!!! Please read the FAQ:https://github.com/PaddlePaddle/PaddleOCR#faq If your model has tps module: TPS does not support variable shape. Please set --rec_image_shape='3,32,100' and --rec_char_type='en'

老师,你好,我在测试SRN的推理模型时,报上述错误,请问这是什么原因呢?推理模型就是你们发布的预训练模型转换过来的。

指派人
分配到
无
里程碑
无
分配里程碑
工时统计
无
截止日期
无
标识: paddlepaddle/PaddleOCR#748
渝ICP备2023009037号

京公网安备11010502055752号

网络110报警服务 Powered by GitLab CE v13.7
开源知识
Git 入门 Pro Git 电子书 在线学 Git
Markdown 基础入门 IT 技术知识开源图谱
帮助
使用手册 反馈建议 博客
《GitCode 隐私声明》 《GitCode 服务条款》 关于GitCode
Powered by GitLab CE v13.7