Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error importing keras model #7013

Closed
lo2aayy opened this issue Jan 15, 2019 · 2 comments

Comments

Projects
None yet
3 participants
@lo2aayy
Copy link

commented Jan 15, 2019

When trying to import the following keras model: (note conv2d_1 input shape (20,300,1)
image

The Kerasimporter in dl4j reads the input shuffled; (h=300,w=1,c=20)
I get the following error:

Exception in thread "main" org.deeplearning4j.exception.DL4JInvalidConfigException: Invalid configuration for layer (idx=-1, name=conv2d_1, type=ConvolutionLayer) for width dimension: Invalid input configuration for kernel width. Require 0 < kW <= inWidth + 2*padW; got (kW=300, inWidth=1, padW=0)
Input type = InputTypeConvolutional(h=300,w=1,c=20), kernel = [6, 300], strides = [1, 1], padding = [0, 0], layer size (output channels) = 100, convolution mode = Truncate
at org.deeplearning4j.nn.conf.layers.InputTypeUtil.getOutputTypeCnnLayers(InputTypeUtil.java:335)
at org.deeplearning4j.nn.conf.layers.ConvolutionLayer.getOutputType(ConvolutionLayer.java:184)
at org.deeplearning4j.nn.modelimport.keras.layers.convolutional.KerasConvolution2D.getOutputType(KerasConvolution2D.java:150)
at org.deeplearning4j.nn.modelimport.keras.KerasModel.inferOutputTypes(KerasModel.java:304)
at org.deeplearning4j.nn.modelimport.keras.KerasModel.(KerasModel.java:179)
at org.deeplearning4j.nn.modelimport.keras.KerasModel.(KerasModel.java:96)
at org.deeplearning4j.nn.modelimport.keras.utils.KerasModelBuilder.buildModel(KerasModelBuilder.java:307)
at org.deeplearning4j.nn.modelimport.keras.KerasModelImport.importKerasModelAndWeights(KerasModelImport.java:144)
at dl4jTrial.main(dl4jTrial.java:46)

Version Information

Deeplearning4j version: 1.0.0-beta3
platform information: Linux CentOS

Attached is the model
model.h5.tar.gz

@farizrahman4u

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

Fixed #7501

@lock

This comment has been minimized.

Copy link

commented May 10, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 10, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.