You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Epoch 1/100
WARNING:tensorflow:Model was constructed with shape (None, 10000, 3) for input KerasTensor(type_spec=TensorSpec(shape=(None, 10000, 3), dtype=tf.float32, name='lstm_16_input'), name='lstm_16_input', description="created by layer 'lstm_16_input'"), but it was called on an input with incompatible shape (None, 18727, 3).
WARNING:tensorflow:Model was constructed with shape (None, 10000, 3) for input KerasTensor(type_spec=TensorSpec(shape=(None, 10000, 3), dtype=tf.float32, name='lstm_16_input'), name='lstm_16_input', description="created by layer 'lstm_16_input'"), but it was called on an input with incompatible shape (None, 18727, 3).
1/1 [==============================] - ETA: 0s - loss: 9914.3594 - accuracy: 5.3399e-04
This is the input code I've Given:
X_array=np.asarray(X_train).astype(np.int)
y_array=np.asarray(y_train).astype(np.int)
X_shaped = np.reshape(X_array, newshape=(-1,18727,3))
y_shaped = np.reshape(y_array,newshape=(-1,18727,2))
model = Sequential()
model.add(LSTM(units=1, input_shape=(10000,3), return_sequences=True))
model.add(LSTMt_shape=(1,18727,3),dropout=0.25,return_sequences=True, input_shape=(-1,18727,2)))
model.add(LSTM(132,batch_input_shape=(1,18727,2),dropout=0.25,return_sequences=True))
model.add(Dense(1,batch_input_shape=(1,18727,3),activation='softmax',batch_size=32))
model.add(Dense(1,batch_input_shape=(1,18727,2),activation='softmax',batch_size=32))
model.compile(loss="mean_absolute_error", optimizer="adam", metrics= ['accuracy'])
model.compile(loss='mse', optimizer='rmsprop',metrics=['accuracy'])## Binary cross entropy/ categorical cross
start = time.time()
print ('compilation time : ', time.time() - start) (units=1, input_shape=(4000,2), return_sequences=True))
model.add(LSTM(132,batch_input)
The Error im getting is this:
Epoch 1/100
WARNING:tensorflow:Model was constructed with shape (None, 10000, 3) for input KerasTensor(type_spec=TensorSpec(shape=(None, 10000, 3), dtype=tf.float32, name='lstm_16_input'), name='lstm_16_input', description="created by layer 'lstm_16_input'"), but it was called on an input with incompatible shape (None, 18727, 3).
WARNING:tensorflow:Model was constructed with shape (None, 10000, 3) for input KerasTensor(type_spec=TensorSpec(shape=(None, 10000, 3), dtype=tf.float32, name='lstm_16_input'), name='lstm_16_input', description="created by layer 'lstm_16_input'"), but it was called on an input with incompatible shape (None, 18727, 3).
1/1 [==============================] - ETA: 0s - loss: 9914.3594 - accuracy: 5.3399e-04
ValueError Traceback (most recent call last)
in ()
6 #y_scaled = scaler.fit_transform(y_shaped)
7 #print(X_scaled,y_scaled)
----> 8 history = model.fit(X_shaped,y_shaped,epochs=100, validation_data=(X_array,y_array))
9 print(model.summary())
10 frames
/usr/local/lib/python3.7/dist-packages/tensorflow/python/framework/func_graph.py in wrapper(*args, **kwargs)
975 except Exception as e: # pylint:disable=broad-except
976 if hasattr(e, "ag_error_metadata"):
--> 977 raise e.ag_error_metadata.to_exception(e)
978 else:
979 raise
ValueError: in user code:
The text was updated successfully, but these errors were encountered: