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

The dimension of the inputs #8

Closed
faruihuihui opened this issue May 21, 2017 · 2 comments
Closed

The dimension of the inputs #8

faruihuihui opened this issue May 21, 2017 · 2 comments

Comments

@faruihuihui
Copy link

Hi

I was trying to run the example in the front page, but got an error as
"The channel dimension of the inputs should be defined. Found None "
It seems that Convolution2D doesn't accept the input shape as "None".
How to make it working? Thanks.

The full error message is as follows:
ValueError Traceback (most recent call last)
in ()
11
12 # uses theano ordering. Note that we leave the image size as None to allow multiple image sizes
---> 13 model.add(Convolution2D(32, 3, 3, border_mode='same', input_shape=(3, None, None)))
14 model.add(Activation('relu'))
15 model.add(Convolution2D(32, 3, 3))

/home/u3714/.conda/envs/test_env/lib/python3.5/site-packages/keras/models.py in add(self, layer)
420 # and create the node connecting the current layer
421 # to the input layer we just created.
--> 422 layer(x)
423
424 if len(layer.inbound_nodes) != 1:

/home/u3714/.conda/envs/test_env/lib/python3.5/site-packages/keras/engine/topology.py in call(self, inputs, **kwargs)
526 'layer.build(batch_input_shape)')
527 if len(input_shapes) == 1:
--> 528 self.build(input_shapes[0])
529 else:
530 self.build(input_shapes)

/home/u3714/.conda/envs/test_env/lib/python3.5/site-packages/keras/layers/convolutional.py in build(self, input_shape)
123 channel_axis = -1
124 if input_shape[channel_axis] is None:
--> 125 raise ValueError('The channel dimension of the inputs '
126 'should be defined. Found None.')
127 input_dim = input_shape[channel_axis]

ValueError: The channel dimension of the inputs should be defined. Found None.

@yhenon
Copy link
Owner

yhenon commented May 22, 2017

I'm rather confident this is an issue to do with dim_ordering - can you look at fixes here keras-team/keras#5900 and tell me if it fixes things?

@faruihuihui
Copy link
Author

Great! Thanks! It works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants