Fixed to work with keras2onnx-made models #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Using an ONNX model made from keras2onnx resulted in the error discussed here: #23
So, I went and fixed the code to work for such models. I left the old code in comments in case this broke something for ONNX models made via other means.
However, now that it's working for me, I am finding slightly different predictions between the Keras model and the model from onnx2keras (Keras compile model-->keras2onnx save-->onnx load-->onnx2keras). I'm not sure at what point in that conversion link the difference(s) is(are) being introduced. In my case, the differences are -0.1% +- 2.3%, with the worst difference being 9.3%.I did some additional testing of the ONNX file by using other software to make the predictions, and the onnx2keras model predictions are identical. So, the differences in outputs are confirmed to not be due to onnx2keras.