Course Name: Neural Networks in Trading, Section No: 6, Unit No: 14, Unit type: Notebook
Not able to run the below code :
model = Sequential()
model.add(LSTM(4, input_shape=(
X_train.shape[1], X_train.shape[2]), return_sequences=True))
model.add(Dense(neurons, activation=act))
model.add(Dropout(dropout_ratio))
model.add(Dense(neurons2, activation=act))
model.add(Dropout(dropout_ratio))
model.add(Dense(neurons3, activation=act))
model.add(Dropout(dropout_ratio))
model.add(Dense(neurons4, activation=act))
model.add(Dropout(dropout_ratio))
model.add(Dense(neurons5, activation=act))
model.add(Dropout(dropout_ratio))
model.add(Dense(1))
model.compile(loss='mean_squared_error', optimizer='adam', metrics=['mse'])
Here is the error :
NotImplementedError: Cannot convert a symbolic Tensor (lstm/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