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

[Frontend][Relay] Keras softmax and prelu fix under NHWC #6278

Merged
merged 1 commit into from
Aug 25, 2020
Merged

[Frontend][Relay] Keras softmax and prelu fix under NHWC #6278

merged 1 commit into from
Aug 25, 2020

Conversation

domin1985
Copy link
Contributor

Hi,
Tvm error occurred when I imported a pre-trained keras model with NHWC layout:

TVMError:
Error(s) have occurred. The program has been annotated with them:
In main:
%0 = negative(%v_param_3);
%1 = nn.conv2d(%input_1, %v_param_1, padding=[4, 4], channels=64, kernel_size=[9, 9], data_layout="NHWC", kernel_layout="HWIO");
%2 = nn.bias_add(%1, %v_param_2, axis=-1);
%3 = negative(%2);
%4 = nn.relu(%3);
%5 = multiply(%0, %4) Incompatible broadcast type TensorType([64, 1, 1], float32) and TensorType([1, (int64)96, (int64)96, 64], float32); ;
%6 = nn.relu(%2);

softmax and prelu convertion should take layout into consideration.
@siju-samuel @yongwww @jwfromm

@domin1985 domin1985 changed the title [Frontend][Relay] Keras softmax and prelu fix [Frontend][Relay] Keras softmax and prelu fix under NHWC Aug 17, 2020
@tqchen
Copy link
Member

tqchen commented Aug 21, 2020

@kazum please also help to manage the PR

Copy link
Contributor

@jwfromm jwfromm left a comment

Choose a reason for hiding this comment

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

This all looks good to me, thanks for the fix!

Copy link
Member

@yongwww yongwww left a comment

Choose a reason for hiding this comment

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

LGTM

@kazum
Copy link
Contributor

kazum commented Aug 24, 2020

@domin1985 The change looks good. Could you rebase against the master to trigger the CI?

* prelu and softmax with NHWC layout consideration

* fix lint

* fix lint
@kazum kazum merged commit a189fe0 into apache:master Aug 25, 2020
@kazum
Copy link
Contributor

kazum commented Aug 25, 2020

Thanks @domin1985 @leandron @jwfromm @yongwww !

trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
)

* prelu and softmax with NHWC layout consideration

* fix lint

* fix lint

Co-authored-by: Dongming Yang <[email protected]>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
)

* prelu and softmax with NHWC layout consideration

* fix lint

* fix lint

Co-authored-by: Dongming Yang <[email protected]>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Aug 26, 2020
)

* prelu and softmax with NHWC layout consideration

* fix lint

* fix lint

Co-authored-by: Dongming Yang <[email protected]>
trevor-m pushed a commit to trevor-m/tvm that referenced this pull request Sep 2, 2020
)

* prelu and softmax with NHWC layout consideration

* fix lint

* fix lint

Co-authored-by: Dongming Yang <[email protected]>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Sep 3, 2020
)

* prelu and softmax with NHWC layout consideration

* fix lint

* fix lint

Co-authored-by: Dongming Yang <[email protected]>
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.

7 participants