Skip to content

Replace deprecated ResizeBilinear for EAST #479

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

Merged
merged 1 commit into from
Jul 5, 2023

Conversation

VictorHe-1
Copy link
Collaborator

Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:

Motivation

Change this API to accept dynamic shape input

Test Plan

Already tested and model results are the same.

Related Issues and PRs

(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

@HaoyangLee HaoyangLee merged commit a60dc65 into mindspore-lab:main Jul 5, 2023
@@ -280,17 +280,17 @@ def __init__(self, in_channels, out_channels=128):
def construct(self, features):
f1, f2, f3, f4 = features

out = ops.ResizeBilinear(f3.shape[2:], True)(f4)
out = ops.ResizeBilinearV2(True)(f4, f3.shape[2:])
Copy link
Collaborator

Choose a reason for hiding this comment

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

Will operator initialization inside construct affect execution speed in PyNative mode? Will it be better to initialize the operator once in __init__ (e.g. self.resize = ops.ResizeBilinearV2(True)) and then use it directly inside construct?

Copy link
Collaborator Author

@VictorHe-1 VictorHe-1 Jul 5, 2023

Choose a reason for hiding this comment

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

Yes, it's better to define ops.ResizeBilinearV2(True) in __init__, then call it in the construct function. But I'm not sure if it will be a problem to export the existing ckpt file to MindIR after adding this line of code. The above codes are ok for the current ckpt file to export.

Copy link
Collaborator Author

@VictorHe-1 VictorHe-1 Jul 5, 2023

Choose a reason for hiding this comment

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

I'll try it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants