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

NCHW to NHWC clarification #2

Open
cmatija opened this issue Jan 3, 2019 · 1 comment
Open

NCHW to NHWC clarification #2

cmatija opened this issue Jan 3, 2019 · 1 comment

Comments

@cmatija
Copy link

cmatija commented Jan 3, 2019

Thank you very much for the great code. However, I am confused about the conversion from NCHW to NHWC in lines 52/53 of lpips_tf.py. Shouldn't the correct permutation vector be [0,2,3,1] as opposed to [0,3,1,2]? I have noticed that using [0,2,3,1] I get an error later, so I guess it is the correct vector after all, however, I can't wrap my head around as to how, to achieve permutation from NCHW to NHWC, any other permutation vector than [0,2,3,1] is used. May I ask for some clarification on this matter?

@alexlee-gk
Copy link
Owner

You are indeed correct that the permutation should be [0,2,3,1] to convert from NCHW to NHWC. The mistake was in the comment—it actually does a NHWC to NCHW conversion, and not the other way around. I fixed the comment to reflect this. Thanks for pointing it out!

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

No branches or pull requests

2 participants