I created a LSTM model and wanted to run it. Once it comes to training the model, there is a bug that the code gets stuck.
The terminal only displays Epoch 1/30
and afterwards nothing happens and it gets stuck. I can’t even terminate it with ctrl + c.
This is the code:
lstm_input = Input(shape=(num_candles, 8), name="lstm_input")
inputs = LSTM(150, name="first_layer")(lstm_input)
inputs = Dense(1, name="dense_layer")(inputs)
output = Activation("linear", name="output")(inputs)
model = Model(inputs=lstm_input, outputs=output)
adam = optimizers.Adam()
model.compile(optimizer=adam, loss="mse")
model.fit(x=X_train, y=y_train, batch_size=15, epochs=30, shuffle=True, validation_split = 0.1, verbose=1)
I found out it is because of Apple Silicon, I am working on a MacBook Air M2. The code works on Google Colab.
I tried installing tensorflow-metal, tf-nightly, tensorflow-macos, nothing worked.
I have the newest versions, still doesn’t work. Is there a fix to this bug?