I'm currently following this tutorial for multi-variate time series LSTM https://machinelearningmastery.com/multivariate-time-series-forecasting-lstms-keras/?unapproved=616760&moderation-hash=4e3c737e7c47cf8d889faaf84c3f73db#comment-616760
I am running into an issue when we build the model:
from math import sqrt
from numpy import concatenate
from matplotlib import pyplot
from pandas import read_csv
from pandas import DataFrame
from pandas import concat
from sklearn.preprocessing import MinMaxScaler
from sklearn.preprocessing import LabelEncoder
from sklearn.metrics import mean_squared_error
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
...
# design network
model = Sequential()
model.add(LSTM(50, input_shape=(train_X.shape[1], train_X.shape[2]))) #error here
The error I'm getting is NotImplementedError: Cannot convert a symbolic Tensor (lstm_4/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
Everything else seems to run though. I get a gain/loss plot and everything. This particular section of code just gives me this error. I had looked it up and some people got this error after not installing Tensorflow properly. As far as I can tell, it is installed fine and doesn't seem to give me any issues when I had imported it.
I am using Spyder 5.0.5 which would be on Python 3.7.9; however, my specific environment in Spyder is Miniconda 3 which is Python 3.9.5. Uninstalling and reinstalling my packages doesn't seem to work. Upgrading my packages yields a message basically stating that there are no upgrades to install.
EDIT:
TensorFlow version 2.5.0
keras version 2.5.0
numpy version 1.20.3