Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
65 views

How to import dataset for image sequence classification?

I want to build a model (RNN) on an image sequence to predict a binary variable. I saw a lot of tutorials for multi-input classification, but I didn't find anywhere how to import my data ? I have a ...
user25720613's user avatar
0 votes
1 answer
106 views

Why does my SimpleRNN model in Sequential API show '?' for output shape and zero trainable parameters when using Embedding layers?

I'm building a SimpleRNN model with an Embedding layer in Keras and encountering an issue when using the Sequential API. The model summary shows the output shape as ? and the number of trainable ...
Arjun Kumar's user avatar
0 votes
1 answer
76 views

Tensorflow saving model works but loading it doesn't

I trained an LSTM model in tensorflow, and it works fine, but when I save the model and then try to load it from disk, it throws me a ValueError when loading. FYI saving and loading works for other ...
AyoubLaar's user avatar
0 votes
0 answers
15 views

can we use Keras Sequential model with dense layers for non-temporal data

can we use Keras Sequential model with dense layers for non-temporal data i want to use deep learning methods with a tabular dataset of depression i found that we can use keras sequential model with ...
hajar ait chebri's user avatar
0 votes
0 answers
47 views

I'm having issues w/ my RNN; keeps predicting too high numbers

So I'm creating a frame AI network to predict substantial outbreaks throughout the world. The first step of my process is predicting factor data over the next couple of years. So far, I've been ...
Mufarrid Ansari's user avatar
0 votes
0 answers
36 views

Nevertheless input different 'data.csv' |Why RNN result's always linear?

It's my forecast code import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import MinMaxScaler from tensorflow.keras.models import Sequential from ...
tuk_shin19's user avatar
0 votes
0 answers
157 views

RNN - LSTM model for multivariate time series

I'm using LSTM for time series forecasting. This is my dataset: enter image description here X1,...,5 is the multivariate time serie, y the value to predict and mean, std, var, median, volume are the ...
Ismaele Le Voci's user avatar
1 vote
1 answer
92 views

Fitting an RNN model using a tensorflow dataset

I'm still new to using TensorFlow datasets and would like some help with the following. Assume I have a matrix where each row is an observation and I would like to use the window function in order to ...
user3245747's user avatar
0 votes
1 answer
30 views

Tensorflow error InvalidArgumentError: indices[42,244] = -1 is not in [0, 7000)

I am new to neural networks and I am trying to train an LSTM network with the following code: # Split the data into training and testing set X_train, X_test, y_train, y_test = train_test_split(X, y, ...
Michal Goldstein's user avatar
1 vote
1 answer
184 views

Tensorflow simple cumulative sum of product RNN cell

I am trying to build a Tensorflow model that calculates a cumulative sum of products of two of the input features, i.e. predicting on only (1,2) should return 2, and then predicting on (2,2) should ...
Simon Chemnitz-Thomsen's user avatar
0 votes
0 answers
115 views

RNN Keras Error || No OpKernel was registered to support Op 'CudnnRNN' used by {{node CudnnRNN}} with these attrs

I am currently working on a RNN using Keras, but I am stuck with this error: --------------------------------------------------------------------------- ValueError ...
roty2Poulet's user avatar
0 votes
1 answer
89 views

Why is my RNN model outputting the error: 'Input 0 of layer is incompatible with the layer'?

I have issue in my RNN model. The error is: Input 0 of layer "sequential_3" is incompatible with the layer: expected shape=(None, 90, 3), found shape=(None, 3). I still don't know how to ...
Alwan Rahmana Subian's user avatar
-1 votes
1 answer
34 views

ValueError: Input 0 is incompatible with layer lstm_35: expected ndim=3, found ndim=2

I am trying a regression problem with signals with a lstm. The shape of X_train is (3867,5000,1) and X_test(1998,5000,1). I have this error "ValueError: Input 0 is incompatible with layer lstm_35:...
David Sanchez Hommen's user avatar
1 vote
0 answers
85 views

ValueError: No gradients provided for any variable: (['embedding_1/embeddings:0', 'image_layer_1/kernel:0', 'image_layer_1/bias:0',

This is a program that generates captions for images and then updates the weights of the model based on the cross entropy loss. While updating the weights of the model, I come across this error and ...
pyComali's user avatar
0 votes
0 answers
52 views

why TensorFlow LSTM RNN fails to predict a target even if data contains it?

I have a time series DS containing ~800k time steps. I am trying to train a simple LSTM RNN using TensorFlow/Keras. After several unsuccessful tries to predict any useful (meaningful) target I decided ...
bellerofonte's user avatar
0 votes
1 answer
83 views

Keras SimpleRNNCell appears to fail to distribute learning among all its weights

This question is about SimpleRNNCell, a class in Tensorflow to perform basic Recurrent Neural Network. Unless there's something fundamentally wrong in my code, it appears that training is not spread ...
pfaz's user avatar
  • 3
1 vote
0 answers
55 views

Multi Station time series forecast of flood through LSTM

I need to make flood forecast for 11 different stations. Each station require different forecast i.e. flood level (water inflow in cusecs) is different for different stations. Can A single LSTM model ...
Khansa's user avatar
  • 9
1 vote
0 answers
52 views

InvalidArgumentError: slice index 1 of dimension 2 out of bounds when training GRU RNN

I'm a newbie in the world of recurrent neural networks and I am trying to follow a TensorFlow tutorial. This tutorial makes forecasting on weather time series data, and trains a LSTM model for it also....
Zoltán Orosz's user avatar
0 votes
0 answers
50 views

My multilabel classification RNN is not learning

I have made a model that tries to predict the chances of every piano key playing in a time step given all time steps before it. I tried making a GRU network with 88 outputs(one for every piano key) ...
Ilan Kayesar's user avatar
1 vote
0 answers
59 views

Why do I get different results when I use predict with all history and in real time using keras?

I wanna use predictions in real time, but I want to test that the results are the same as in the case of giving all the data as input only once. This is the code: import numpy as np from keras.layers ...
Jose Gonzalez B's user avatar
1 vote
0 answers
99 views

How point wise multiplication and addition takes place in LSTM?

timesteps=4, features=2 and LSTM(units=3) Input to lstm will be (batch_size, timesteps, features) dimensions of the hidden State and cell state will be (None, unit in LSTM). When lstm take the input ...
Hasnat's user avatar
  • 49
0 votes
0 answers
55 views

Class weights not working with return_sequences Keras

'''' #x_train format = [samples, timesteps, features] #y_train format = [samples, timesteps] num_timesteps = len(x_train[0]) num_features = len(x_train[0, 0]) num_classes = 3 model = Sequential() ...
ChaddersCheese's user avatar
0 votes
0 answers
523 views

How can I reduce the batch size after a certain epoch or implement a adaptive batch size in deep learning?

I've implemented a BiLSTM model for classifying positive or negative sentiments from texts. Here, my batch size is constant in this code, which is 256 and epoch 60, but I want to reduce the batch size ...
Sunjaree's user avatar
  • 138
0 votes
0 answers
80 views

Feeding UCF101 dataset through TensorFlow RNN

I am currently trying to build an RNN for the UCF101 dataset using TensorFlow. The dataset can easily be loaded using tensorflow_datasets like so: (train, test) = tfds.load('ucf101', split = ['train', ...
Maxwell's user avatar
  • 39
0 votes
0 answers
49 views

Sequential Keras model is able to predict different size of input?

I am new to recurrent networks and nlp. I try to create a text generation model. First I padded my sequences in order to prevent shape mismatch during training: [1505, 422, 63, 324], [ 7, 63, ...
sjoi84's user avatar
  • 1
0 votes
0 answers
2k views

Exception encountered when calling layer "model_5" (type Functional)

This is the following code : Hyper parameters batch_size = 64 nb_epoch = 50 Parameters for dataset img_rows, img_cols = 160, 160 nb_classes = 10 Parameters for network nb_lstm_outputs = 30 ...
Mehedi Hasan's user avatar
-2 votes
1 answer
4k views

Exception encountered when calling layer "model" (type Functional)

ValueError: Exception encountered when calling layer "model_5" (type Functional). Input 0 of layer "gru_21" is incompatible with the layer: expected ndim=3, found ndim=4. ...
Mehedi Hasan's user avatar
0 votes
1 answer
104 views

What does "ValueError: cannot reshape array of size 279936 into shape (529,529)" mean?

I was trying to run some RNN code. # Original Dimensions #ratio = 4 #image_width = int(image_width / ratio) #image_height = int(image_height / ratio) channels = 1 nb_classes ...
SaviorTech's user avatar
1 vote
0 answers
523 views

In TensorFlow/Keras, how do you use the `add_loss` method inside a custom RNN cell?

My Goal: Use the add_loss method inside a custom RNN cell (in graph execution mode) to add an input-dependent loss. General Setup: Using Python 3.9 Using TensorFlow 2.8 or 2.10 Assuming import ...
colorado_roads's user avatar
1 vote
1 answer
55 views

Predict text binary classification with RNN and didn't get expected output

I'm doing Amazon review sentiment analysis with RNN and LSTM. df2['Texts'] are Amazon customer reviews, and df2['label'] are binary integer 0 or 1. tokenizer = Tokenizer(num_words=5000, split=' ') ...
Lorry Zou's user avatar
0 votes
0 answers
568 views

AttributeError: 'CuDNNLSTM' object has no attribute 'unroll'

I am trying to use Sherpa framework for population based training with this model x1 = Input((window_size, 3), name='x1') x2 = Input((window_size, 3), name='x2') convA1 = Conv1D(hidden_num,...
Arman Asgharpoor's user avatar
0 votes
1 answer
99 views

LSTM custom Loss function caued error. ValueError: too many values to unpack (expected 4)

I tried to implement LSTM with custom function by tf.random.set_seed(7) model = Sequential() model.add(LSTM(100, input_shape=(18,1 ), return_sequences=True)) model.add(Dropout(0.2)) #model.add(LSTM(...
Arman Asgharpoor's user avatar
1 vote
1 answer
447 views

How to buid keras model with multi dimensional input multi dimensional output

I want to use sensor reading to estimate some quantities. My sensor readings in each time step have 9 elements and the out quantities have 4 elements input_size = (304414,9) target_size = (304414,4) ...
Arman Asgharpoor's user avatar
1 vote
1 answer
133 views

Multi dimensional input multi dimensional output rnn keras data preprocessing

I want to create a RNN model in Keras. In each time-step the input has 9 element and the output has 4 element. input_size = (304414,9) target_size = (304414,4) How can I create a dataset of sliding ...
Arman Asgharpoor's user avatar
1 vote
1 answer
371 views

LSTM model has poor prediction in simple example

I am trying to generate a LSTM model using Keras. I create a simple sine wave example which contain more thang 1000 point to predict the next point. But the result is not good as i expected. When i ...
lam tran's user avatar
0 votes
2 answers
348 views

Keras RNN, incorrect shape of input even though shape is shown as correct

I am attempting to train an RNN to classify texts. On my computer, i have a large text file with all of the phrases to train the network on for each category (2 total), e.g Phrase 1 Phrase 2 Phrase ...
Mercury's user avatar
  • 310
0 votes
0 answers
98 views

inject the output of the network into the input layer of the next time step

I am trying to build an LSTM network using quarterly time series, making a forecast named yt (0 or 1) for each quarter. Here is the network I am currently using: model = tf.keras.models.Sequential() ...
Virginie Gautier's user avatar
0 votes
1 answer
321 views

ValueError issue when using LSTM layer in tensorflow

I am trying to build up a very simple LSTM structure using padding and masking to learn how to train time series data. Suppose I have two people's blood value information per month. For the first ...
sergey_208's user avatar
0 votes
0 answers
156 views

How to reshape dataset as input for RNN in Tensorflow

i try to feed my model with dataset values but i get a shape error. Can somebody help with it and explain how it works with datasets? Many thanks import pandas as pd import tensorflow as tf import ...
alexka's user avatar
  • 33
0 votes
2 answers
741 views

Need to increase the accuracy of my LSTM model

This is my model # normalize the dataset scaler = MinMaxScaler(feature_range=(0, 1)) dataset = scaler.fit_transform(df) train_size = int(len(dataset) * 0.8) test_size = len(dataset) - train_size ...
user avatar
3 votes
1 answer
3k views

Weights and Bias dimensions in TensorFlow for LSTM

I am confused about the dimensions of the hidden weight array for an LSTM. I understand the input weight and bias dimension just fine. Now I just recently started learning about RNNs and LSTMs so ...
ScubaNinjaDog's user avatar
0 votes
1 answer
188 views

ValueError of Input and Output values during LSTM training

I was trying to implement a basic LSTM network using some random data, and I got the following error during execution of the code ''' Traceback (most recent call last): File "C:/Users/dell/...
chcheetah's user avatar
1 vote
1 answer
928 views

Accessing the elements of an Input Layer in a keras model

I am trying to compile and train an RNN model for regression using Keras Tensorflow. I am using the "Functional API" way for the definition of my model. I need to have 2 different inputs. ...
MJ13's user avatar
  • 195
0 votes
1 answer
74 views

How to define size of input in Recurrent Neural Network for unsupervised learning model?

I'm trying to fit a neural network model(unsupervised). I have only an input x, which is a vector with 10000 components, and I have an output, which is also a vector of the same size as x. I've ...
math's user avatar
  • 121
1 vote
1 answer
311 views

tf.get_shape() returning None incorrectly

I'm currently trying to create a WGAN implementation with gradient penalty in keras following the setup here: https://keras.io/examples/generative/wgan_gp/. However, I have modified this to generate ...
mattg's user avatar
  • 45
0 votes
0 answers
103 views

Is there a way to get the real sequence_length in the model description of a RNN/LSTM in Keras?

I would like to get to know the real sequence_length in Keras for a LSTM/RNN. Unfortunately, when I print the model I only get None all the time as a value. Here is a part of the code: ...
PeterBe's user avatar
  • 870
0 votes
1 answer
258 views

How do I properly make a tf Dataset for recurrent-neural-network?

I have just preprocessed my categories data to one-hot encoding and used tf.argmax(). This way, I got it into a range of numbers of 1 to 34; thus, there are sequences of, say: [7, 4, 28, 14, 5, 15, 22,...
Snykral fa Ashama's user avatar
1 vote
1 answer
979 views

AttributeError: 'NoneType' object has no attribute '_inbound_nodes' when implement an operation between a constant tensor and a keras tensor

I'm implementing a ConvRNN in keras, and the implementation follows this which is originally implemented in Pytorch. When the class ConvRNN is going to return a keras Model(inputs, outputs), then an ...
Kitty's user avatar
  • 21
1 vote
1 answer
3k views

How keras oov_token=True works

By default how does keras impute out-of-vocabulary token when oov_token=True. According to keras official documentation it tells that if given, it will be added to word_index and used to replace out-...
sammy ongaya's user avatar
  • 1,401
0 votes
1 answer
597 views

Cannot load tensorflow saved model back

I am following this tutorial: https://www.tensorflow.org/text/tutorials/text_generation#export_the_generator And i use the following code to save the model and load it back, the saving part works but ...
Pratik Hadawale's user avatar

1
2 3 4 5
12