Coder Social home page Coder Social logo

Comments (4)

fchollet avatar fchollet commented on September 22, 2024 1

x.shape is the "static shape" of x. It is often not a number. It can be None. If you want the actual number value, you must use keras.ops.shape(x), e.g.

keras.ops.sum(keras.ops.square(x - y), axis=0) / keras.ops.shape(x)[0]

from keras.

SuryanarayanaY avatar SuryanarayanaY commented on September 22, 2024

Hi @Ybisalt ,

I have tested the given code with Keras 3.3.3v and it executes fine. Please note that I have changed the code K.sum to keras.ops.sum and same for K.square also. Please refer to attached gist.

from keras.

Ybisalt avatar Ybisalt commented on September 22, 2024

I have tested the given code with Keras 3.3.3v and it executes fine. Please note that I have changed the code K.sum to keras.ops.sum and same for K.square also.

No! Same problem here. You didn't notice "Batch size = None! (None, 4)" line in the last output log.
The number of batches without size depends on the order in which the method is called.

Try just one run of the fit() method (comment out the other fit lines):
log = model.fit(inp_data, out_data, epochs=3, batch_size=30) # Batch size = None!

My gist

from keras.

mehtamansi29 avatar mehtamansi29 commented on September 22, 2024

Hi @Ybisalt -

I am not able to reproduce this issue in lates keras(3.5.0) version. Attached gist for the reference.
Are you still able to reproduce this issue ?

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.