awslabs / keras-apache-mxnet

[DEPRECATED] Amazon Deep Learning's Keras with Apache MXNet support
https://github.com/awslabs/keras-apache-mxnet/wiki
Other
289 stars 65 forks source link

Different layer input/output shapes between tensorflow and mxnet backend #231

Open KocsisV opened 5 years ago

KocsisV commented 5 years ago

Hello!

I'm trying to use keras with mxnet backend (mxnet-cu90mkl==1.3.1), but I ran into an issue. It seems that some layers have different input/output shapes between tensorflow and mxnet. I'm trying to use segmentation_models repository, which runs fine if I use the tensorflow backend. With mxnet backend I receive the following exception: mxnet.base.MXNetError: Error in operator conv0/conv2d1: [14:52:45] src/operator/nn/convolution.cc:193: Check failed: dilated_ksize_y <= AddPad(dshape[2], param_.pad[0]) (7 vs. 6) kernel size exceed input

To reproduce the issue install segmentation_models ( pip3 install segmentation_models ), warning it will install the standard keras package too, reinstall keras-mxnet. Then run the following python code:

from segmentation_models import *
model = Unet( 'resnet34', encoder_weights='imagenet')