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

Keras model exception when predict "Default MaxpoolingOp only supports NHWC on device type CPU" #122

Open
YangMingJerry opened this issue Nov 5, 2020 · 3 comments
Labels

Comments

@YangMingJerry
Copy link

Describe the bug
I successfully convert my CNN pytorch model to a keras model, and want to predict an input for testing it, but this exception occurs. My CPU is intel 8700 and my tensorflow and keras are both up to date.
To Reproduce
Snippet of your code

Expected behavior
A clear and concise description of what you expected to happen.

Logs
If applicable, add error message to help explain your problem.

Environment (please complete the following information):

  • OS: [e.g. iOS]
  • Python [e.g. Python 2, Python 3]
  • Version [e.g. v0.1.11]

Additional context
Add any other context about the problem here.

@henriwoodcock-old
Copy link

On the homepage readme.md read the information under Important Notice here.

Alternatively you can pass change_ordering=True to the function pytorch_to_keras. And transpose your inputs to be in the format used by Tensorflow/Keras.

rand_tens = np.random.rand(1, 3, 224, 224)
print(rand_tens.shape)
(1,3,224,224)

transposed = np.transpose(rand_tens, [0, 2, 3, 1])
print(transposed.shape)
(1, 224, 224, 3)

@AzazelHD
Copy link

AzazelHD commented Jan 6, 2021

When passing change_order=True to the function it sais NotImplementedError: change_ordering for Slice is not implemented. So please, try to fix this. I really need it :(

@henriwoodcock-old
Copy link

@AzazelHD I think that's an Onnx2Keras issue.

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

No branches or pull requests

3 participants