onnx / keras-onnx

Convert tf.keras/Keras models to ONNX
Apache License 2.0
381 stars 109 forks source link

Negative paddings #146

Closed jojaii closed 5 years ago

jojaii commented 5 years ago

The converter is outputting negative paddings in the graph whenever "same" padding is encountered. The model I used is the minixception model (accessible here).

This can be seen in the "conv2d_3" layer in the model. You may download the file here.

Here is a screenshot of the layer when opened with Netron: negative paddings 2

Here is the sample code:

import onnx
from keras.models import load_model
from keras2onnx import convert_keras

model = load_model('fer2013_mini_XCEPTION.107-0.66.hdf5')
onnx_model = convert_keras(model)
onnx.save(onnx_model, 'minixception_sample.onnx')
jiafatom commented 5 years ago

@jojaii I have a fix for this, will check in soon.

jojaii commented 5 years ago

Thanks @jiafatom. Will wait for the fix.

jiafatom commented 5 years ago

Thanks @jiafatom. Will wait for the fix.

@jojaii code checked in, thanks for reporting the issue.