InvalidArgumentError: Graph execution error in fitting the model
When I tried to fit the model it is showing me the error InvalidArgumentError: Graph execution error using the following code. Can any one help me in this regard.
from tensorflow.keras.preprocessing.sequence import TimeseriesGenerator
n_input = 12
n_features = 1
generator=TimeseriesGenerator(scaled_train,scaled_train,n_input, batch_size=1)
X,y = generator[0]
print(f'Given the Array: \n{X.flatten()}')
print(f'Predict this y: \n {y}')
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras.layers import LSTM
model=Sequential()
model.add(LSTM(100,activation='relu',input_shape=(n_input,n_features),return_sequences=True))
model.add(LSTM(50,activation='relu',return_sequences=True))
model.add(LSTM(10,activation='relu'))
model.add(Dense(1))
model.compile(optimizer='adam',loss='mean_squared_error')
model.summary()
model.fit(generator,epochs=10)
YOU CAN FIND THE OUTPUT OF THE ABOVE CODE HERE. PLEASE CLICK TO VIEW
Comments
Post a Comment