0
$\begingroup$

I have a numpy array X_train of shape (number of samples, timestep , number of features) =(1198,60,1)I am trying to create an LSTM layer at the begining of my model :

model=Sequential()

model.add(LSTM(units=50,return_sequences=True,input_shape=(X_train.shape[1],1)))

But this gives me the error :

NotImplementedError: Cannot convert a symbolic Tensor (lstm_8/strided_slice:0) to a numpy array. This error may indicate that you're trying to pass a Tensor to a NumPy call, which is not supported

However, when I remove the input_shape argument everything works fine. So this means that I dont need to specify the input_shape ?

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.