gmalivenko / onnx2keras

Convert ONNX model graph to Keras model format.
MIT License
195 stars 116 forks source link

AttributeError: Cannot convert ConvTranspose2d with groups != 1 #71

Open mengzhi2 opened 4 years ago

mengzhi2 commented 4 years ago

When running the following: import onnx from onnx2keras import onnx_to_keras onnx_model = onnx.load('resnet18.onnx') k_model = onnx_to_keras(onnx_model, ['input'])

This error occurs. Does anyone know what to do? Thanks. Traceback (most recent call last): File "onnx2keras.py", line 9, in k_model = onnx_to_keras(model, ['input']) File "/onnx2keras/onnx2keras/converter.py", line 180, in onnx_to_keras keras_names File "/onnx2keras/onnx2keras/convolution_layers.py", line 258, in convert_convtranspose raise AttributeError('Cannot convert ConvTranspose2d with groups != 1') AttributeError: Cannot convert ConvTranspose2d with groups != 1

LaCandela commented 4 years ago

I had the same problem.

gmalivenko commented 4 years ago

Hello @LaCandela @mengzhi2 .

Unfortunately, Keras doesn't support groupped ConvTranspose2d : https://www.tensorflow.org/api_docs/python/tf/keras/layers/Conv2DTranspose

In future versions I will implement this feature as I did for Conv2d (using lambdas).

mengzhi2 commented 4 years ago

Got it. Thanks for your reply. Looking forward to your future work.