Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix SAR inference, when batch size>1, norm_img_batch and valid_ratios… #11238

Merged
merged 1 commit into from
Nov 15, 2023

Conversation

shiyunalex
Copy link
Contributor

… shapes do not match

PR 类型 PR types

Bug fixes

PR 变化内容类型 PR changes

APIs

描述 Description

Fix SAR inference bug in tools/infer/predict_rec.py.
When SAR model inferencing with rec_batch_num size>1, an error occured,
ValueError: (InvalidArgument) The 0-th dimension of input[0] and input[1] is expected to be equal.But received input[0]'s shape = [1, 1, 512], input[1]'s shape = [16, 30, 512]. [Hint: Expected inputs_dims[0][j] == inputs_dims[i][j], but received inputs_dims[0][j]:1 != inputs_dims[i][j]:16.] (at /paddle/paddle/phi/kernels/funcs/concat_funcs.h:83)
It cased by valid_ratios 's incorrect shape.This PR aims to fix this bug.

提PR之前的检查 Check-list

  • 这个 PR 是提交到dygraph分支或者是一个cherry-pick,否则请先提交到dygarph分支。
    This PR is pushed to the dygraph branch or cherry-picked from the dygraph branch. Otherwise, please push your changes to the dygraph branch.
  • 这个PR清楚描述了功能,帮助评审能提升效率。This PR have fully described what it does such that reviewers can speedup.
  • 这个PR已经经过本地测试。This PR can be convered by current tests or already test locally by you.

@CLAassistant
Copy link

CLAassistant commented Nov 10, 2023

CLA assistant check
All committers have signed the CLA.

Copy link

paddle-bot bot commented Nov 10, 2023

Thanks for your contribution!

Copy link
Collaborator

@tink2123 tink2123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shiyunalex
Copy link
Contributor Author

It seems like the CI stucked in the training step, maybe we could run it again?:smiley:

@JiaXiao243 JiaXiao243 merged commit fb38d0b into PaddlePaddle:dygraph Nov 15, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants