pytorch2keras
pytorch2keras copied to clipboard
Keras model exception when predict "Default MaxpoolingOp only supports NHWC on device type CPU"
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.
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)
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 :(
@AzazelHD I think that's an Onnx2Keras issue.