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

Not working dim_ordering, if you image_data_format(), SPP layer shape become <None, None> #27

Open
ffalam opened this issue Jun 17, 2021 · 4 comments

Comments

@ffalam
Copy link

ffalam commented Jun 17, 2021

Hi,
This code is not working for dim_ordering. I changed it to image_data_format() , now its working but the problem is that after adding spp layer, the output dimension becomes < None, None> . So can not add a dense layer after that.

The error is:

ValueError: The last dimension of the inputs to Dense should be defined. Found None.

Any idea how to solve this problem ?

@urnotcoward
Copy link

Have you solved this problem? I also encountered the same problem!!!

@chengpei-wu
Copy link

Have you solved this problem? I also encountered the same problem!!!

I meet the same problem, have you solved it?

@chengpei-wu
Copy link

Have you solved this problem? I also encountered the same problem!!!

I meet the same problem, have you solved it?
I replace the code
outputs = K.concatanate(outputs)
by
outputs = K.reshape(outputs, self.num_outputs_per_channel * self.nb_channels)
(it was annotated)
in the last code lines before return.
it works, but I don't know whether it is right for SPP layer

@abdurrashid402
Copy link

abdurrashid402 commented Jul 15, 2023

Hi Please I also meet the same problem . Need Help

`ValueError                                Traceback (most recent call last)
[<ipython-input-14-a398c7a76a74>](https://localhost:8080/#) in <cell line: 3>()
      1 # uses theano ordering. Note that we leave the image size as None to allow multiple image sizes
      2 model = Sequential()
----> 3 model.add(Convolution2D(32, 3, 3, input_shape=(1, None, None)))
      4 model.add(Activation('relu'))
      5 model.add(Convolution2D(32, 3, 3))

2 frames
[/usr/local/lib/python3.10/dist-packages/keras/layers/convolutional/base_conv.py](https://localhost:8080/#) in _get_input_channel(self, input_shape)
    414         channel_axis = self._get_channel_axis()
    415         if input_shape.dims[channel_axis].value is None:
--> 416             raise ValueError(
    417                 "The channel dimension of the inputs should be defined. "
    418                 f"The input_shape received is {input_shape}, "

ValueError: The channel dimension of the inputs should be defined. The input_shape received is (None, 1, None, None), where axis -1 (0-based) is the channel dimension, which found to be `None`.`

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

4 participants