Skip to content

  • 体验新版
    • 正在加载...
  • 登录
  • PaddlePaddle
  • Paddle
  • 合并请求
  • !23526

P
Paddle
  • 项目概览

PaddlePaddle / Paddle
接近 2 年 前同步成功

通知 2323
Star 20933
Fork 5424
  • 代码
    • 文件
    • 提交
    • 分支
    • Tags
    • 贡献者
    • 分支图
    • Diff
  • Issue 1423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
  • Wiki 0
    • Wiki
  • 分析
    • 仓库
    • DevOps
  • 项目成员
  • Pages
P
Paddle
  • 项目概览
    • 项目概览
    • 详情
    • 发布
  • 仓库
    • 仓库
    • 文件
    • 提交
    • 分支
    • 标签
    • 贡献者
    • 分支图
    • 比较
  • Issue 1,423
    • Issue 1,423
    • 列表
    • 看板
    • 标记
    • 里程碑
  • 合并请求 543
    • 合并请求 543
  • Pages
  • 分析
    • 分析
    • 仓库分析
    • DevOps
  • Wiki 0
    • Wiki
  • 成员
    • 成员
  • 收起侧边栏
  • 动态
  • 分支图
  • 创建新Issue
  • 提交
  • Issue看板

Op(feed) error message enhancement. !23526

  • Report abuse
!23526 已合并 4月 07, 2020 由 saxon_zh@saxon_zh 创建
#<User:0x00007f2f98ecb4f8>
  • 概览 1
  • 提交 1
  • 变更 1

Created by: Xreki

feed_op报错信息增强 [仅C++端]

1. 使用OP_INOUT_CHECK,增加输入、输出是否设置的检查。

由于feed_op继承的是OperatorBase,当输入或者输出没有设置时,在进入RunImpl函数之前就会报错,因此修改前后报错信息一样,具体如下:

  • 没有设置输入

    Error: Operator feed's input, X, is not set at (/paddle/paddle/fluid/framework/operator.cc:382)
  • 没有设置输出

    Error: Operator feed's output, Out, is not set at (/paddle/paddle/fluid/framework/operator.cc:390)

2. 增强scope中,输入、输出变量是否存在的检查

  • 检查scope中输入变量是否存在

    • 修改前
    Error: Cannot find feed_var in scope, feed_var_name is feed at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:39)
      [operator < feed > error]
    • 修改后
    NotFoundError: Input varibale(feed) cannot be found in scope for operator 'Feed'.
      [Hint: feed_var should not be null.] at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:40)
      [operator < feed > error]
  • 检查scope中输出变量是否存在

    • 修改前
    Error: Cannot find out_var in scope, out_var_name is out_0 at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:45)
      [operator < feed > error]
    • 修改后
    NotFoundError: Output variable(out_0) cannot be found in scope for operator 'Feed'
      [Hint: out_var should not be null.] at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:48)
      [operator < feed > error]

3. 增强属性值是否合法的检查

  • 增加col >= 0的检查

    • 设置col = -1,修改前
    Error: An error occurred here. There is no accurate error hint for this error yet. We are continuously in the process of increasing hint for this kind of error check. It would be helpful if you could inform us of how this conversion went by opening a github issue. And we will resolve it with high priority.
      - New issue link: https://github.com/PaddlePaddle/Paddle/issues/new
      - Recommended issue content: all error stack information
      [Hint: Expected static_cast<size_t>(col) < feed_list.size(), but received static_cast<size_t>(col):18446744073709551615 >= feed_list.size():0.] at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:53)
        [operator < feed > error]
    • 设置col = -1,修改后
    InvalidArgumentError: Expected the column index (the attribute 'col' of operator 'Feed') of current feeding variable to be no less than 0. But received column index = -1.
      [Hint: Expected col >= 0, but received col:-1 < 0:0.] at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:56)
      [operator < feed > error]
  • 增强col < feed列表长度的报错信息

    • 修改前
    Error: An error occurred here. There is no accurate error hint for this error yet. We are continuously in the process of increasing hint for this kind of error check. It would be helpful if you could inform us of how this conversion went by opening a github issue. And we will resolve it with high priority.
      - New issue link: https://github.com/PaddlePaddle/Paddle/issues/new
      - Recommended issue content: all error stack information
      [Hint: Expected static_cast<size_t>(col) < feed_list.size(), but received static_cast<size_t>(col):1 >= feed_list.size():0.] at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:53)
         [operator < feed > error]
    • 修改后
    InvalidArgumentError: The column index of current feeding variable is expected to be less than the length of feeding list. But received column index = 1, the length of feeding list = 1
    [Hint: Expected static_cast<size_t>(col) < feed_list.size(), but received static_cast<size_t>(col):1 >= feed_list.size():1.] at (/paddle/paddle/fluid/operators/controlflow/feed_op.cc:68)
    [operator < feed > error]

说明

feed op不是普通op,使用executor执行时,由executor根据用户的feed需求自动插入feed_op来填充用户数据。没有Python API,错误示例难以构造,因此不提供错误示例。

指派人
分配到
审核者
Request review from
无
里程碑
无
分配里程碑
工时统计
标识: paddlepaddle/Paddle!23526
Source branch: github/fork/Xreki/error/feed
渝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