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

lo2aayy opened this issue Jan 15, 2019 · 2 comments


Copy link

commented Jan 15, 2019

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

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(
at org.deeplearning4j.nn.conf.layers.ConvolutionLayer.getOutputType(
at org.deeplearning4j.nn.modelimport.keras.layers.convolutional.KerasConvolution2D.getOutputType(
at org.deeplearning4j.nn.modelimport.keras.KerasModel.inferOutputTypes(
at org.deeplearning4j.nn.modelimport.keras.KerasModel.(
at org.deeplearning4j.nn.modelimport.keras.KerasModel.(
at org.deeplearning4j.nn.modelimport.keras.utils.KerasModelBuilder.buildModel(
at org.deeplearning4j.nn.modelimport.keras.KerasModelImport.importKerasModelAndWeights(
at dl4jTrial.main(

Version Information

Deeplearning4j version: 1.0.0-beta3
platform information: Linux CentOS

Attached is the model


This comment has been minimized.

Copy link

commented Apr 9, 2019

Fixed #7501


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.
None yet
3 participants
You can’t perform that action at this time.