Reputation: 85
I am unable to build an LSTM network because everytime I try to create it using the code below I get the following error:
NotImplementedError: Cannot convert a symbolic Tensor (lstm_15/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
My code is as follows:
rnn_model = Sequential()
rnn_model.add(LSTM(16,input_shape=(20,1)))
rnn_model.add(Dense(10))
rnn_model.add(Dense(1))
What is going wrong exactly?
Upvotes: 1
Views: 6585
Reputation: 19
It's because you are using a non-compatible version of NumPy. If you are using TensorFlow 2.4.1 you need to use the following version of Numpy:
pip install -U numpy==1.19.2
Upvotes: 1