Comments (3)
Embedding layers work fine with batches (see the imdb_lstm.py example, where batch_size=16). Can you post your model and explain what you were trying to do?
from keras.
Sorry I'm new to this whole reporting thing, so please bear with me :)
I already changed the code I reported here to something else, but if you go to the imdb_lstm.py example and replace:
model.add(LSTM(256, 128))
with
model.add(Dense(256, 128))
you get this error, with batch sizes that are not equal to the second dimension of the dataset. Maybe I'm wrong but removing recurrency shouldn't affect the model's functionality so much.
But if you also go on and replace:
model.add(Embedding(max_features, 256))
with
model.add(Dense(maxlen, 256))
then it works. I suspect it's something about how the embedding layer indexes its vectors. But maybe I'm just missing something. Ideas?
from keras.
Nevermind, I figured it out eventually: moving from embedding/feedforward/recurrent requires a lot of reshape and flatten inbetween.
from keras.
Related Issues (20)
- Cannot load nested model / model with sub-model HOT 1
- RuntimeError when using keras 3 with pytorch backend in example of VAE model HOT 2
- Possibly unintended regression (though maybe intended?) HOT 3
- Run validation every N batches HOT 6
- Round trip keras saving changes model's output format with dict inputs => single output HOT 3
- CategoryEncoding layer with output_mode count as part of a model no longer working in TensorFlow 2.16.1 HOT 1
- MLX Backend HOT 4
- `keras.ops.nan_to_num` doesn't have a `nan` argument HOT 2
- batch_normalization issue when trying to load model HOT 2
- Need help to understand the logic here HOT 1
- [BUG] Conflicting `loss_weights` implementation in Keras3 for single output case. HOT 6
- CategoryEncoding layer one hot indices cast to float in graph execution HOT 3
- Any method to get formulation of functions without seeking into source? HOT 2
- There seem some differences between the source code from PyPI and that tagged with v3.2.1 in GitHub. HOT 3
- Rescaling layer on input problems / ValueError: Layer node index out of bounds. inbound_layer = <InputLayer name=keras_tensorCLONE, built=True> HOT 1
- Conv3D crash when the data_format is 'channels_first' and using Tensorflow backend HOT 3
- Misspelled link. HOT 1
- imdb.load_data function returns a python list instead of ndarray object HOT 2
- Returning backend.set_learning_phase HOT 4
- Custom loss defined as a class instance vs function HOT 3
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.