Giter Club home page Giter Club logo

Comments (2)

sachinprasadhs avatar sachinprasadhs commented on September 24, 2024

In the Gist you have provided compute_output_shape and layer output shape both matches, is there anything I'm missing here?

from keras.

AGFACBNNR avatar AGFACBNNR commented on September 24, 2024

The example in that Gist works fine now, surprisingly.
Therefore, I added a new Conv3D example under the original one, since Conv3D and Conv2D are both subclass of BaseConv and may contain similar error. Please refer here.
In the new example, the compute_output_shape can generate a TensorShape([3, 2, 1, 0, 6]), while the layer meets Error during computing.

The Error Message is:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
[<ipython-input-10-83efd0f3eb7a>](https://localhost:8080/#) in <cell line: 1>()
----> 1 l3(x3)

1 frames
[/usr/local/lib/python3.10/dist-packages/keras/src/layers/convolutional/base_conv.py](https://localhost:8080/#) in tf___jit_compiled_convolution_op(self, inputs, kernel)
     10                 try:
     11                     do_return = True
---> 12                     retval_ = ag__.converted_call(ag__.ld(self).convolution_op, (ag__.ld(inputs), ag__.ld(kernel)), None, fscope)
     13                 except:
     14                     do_return = False

ValueError: Exception encountered when calling layer 'conv3d_4' (type Conv3D).

in user code:

    File "/usr/local/lib/python3.10/dist-packages/keras/src/layers/convolutional/base_conv.py", line 277, in _jit_compiled_convolution_op  *
        return self.convolution_op(inputs, kernel)
    File "/usr/local/lib/python3.10/dist-packages/keras/src/layers/convolutional/base_conv.py", line 262, in convolution_op  **
        return tf.nn.convolution(

    ValueError: Negative dimension size caused by subtracting 2 from 1 for '{{node Conv3D}} = Conv3D[T=DT_FLOAT, data_format="NDHWC", dilations=[1, 1, 1, 1, 1], padding="VALID", strides=[1, 1, 1, 1, 1]](Conv3D/SpaceToBatchND, kernel)' with input shapes: [72,2,2,1,4], [2,2,2,2,6].


Call arguments received by layer 'conv3d_4' (type Conv3D):
  • inputs=tf.Tensor(shape=(3, 4, 4, 4, 4), dtype=float32)

from keras.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.