Comments (4)
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.
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.
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
tokeras.ops.sum
and same forK.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.
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)
- Call on an Embedding model doesnt produce the same result for keras 2 and keras 3 models HOT 5
- the dynamic has a result, but the static inference shape reports an error HOT 2
- mul got incompatible shapes for broadcasting HOT 3
- MultiHeadAttention is using unoptimised einsum equations HOT 5
- Invalid reduction dimension (2 for input with 2 dimension(s) [Op:Sum] HOT 4
- Error: unknown metric function HOT 1
- Inconsistent execution results by the PyTorch backend HOT 1
- "replication_pad1d" not implemented for 'Half' HOT 2
- Add 'pip install -r requirements.txt' to devcontainer.json to reduce contribution efforts HOT 2
- Loss and Gradients not correct when last batch has different size HOT 1
- support for dictionary-type loss functions without explicitly declaring `None` HOT 1
- Model.metrics_names not returning all metrics HOT 2
- Question about Memory Leak (all backends) HOT 7
- TextVectorization returns 'int64' vs 'float32' in TF 2.7 / nightly + Training simple unigram/bigram models much slower than in 2.15 HOT 2
- Custom `tf.keras.metrics.Metric` example fails on GPU in TF 2.17 (but not on nightly): is it possible to get it to work on 2.17? HOT 3
- Allow to pass **kwargs to optimizers.get HOT 1
- How to Convert Keras Modelโs Inference Method (with JAX Backend) to Flax Training State for Using Flax to Predict HOT 5
- Early-stopping does not work properly in Keras 3 when used in a for loop HOT 8
- Add AdEMAMix Optimizer HOT 4
- ValueError: File not found: filepath=Backend\C4__256g_000040000.keras. Please ensure the file is an accessible `.keras` zip file. HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras.