I have been struggling to get my tf code to run at all ever since it randomly started buffering indefinitely. Decided to build a super simple LSTM to fix this error, here is my code:
import pandas as pd
import numpy as np
import plotly
import plotly.express as px
import plotly.graph_objects as go
import requests as req
import yfinance as yf
import seaborn as sns
import bottleneck
import pyarrow
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM, Dense, Input
import numpy as np
# Generate dummy data
x_train = np.random.random((100, 20, 1))
y_train = np.random.random((100, 1))
model = Sequential([
Input(shape=(20, 1)),
LSTM(1),
Dense(1, 'linear')
])
model.compile(optimizer='adam', loss='mse')
model.fit(x_train, y_train, epochs=5, verbose=1)
I have added logging statements into my code and the data processing elements work fine, the problem lies in the actual fitting of the model itself, whenever I run this cell it just returns:
2024-04-27 16:18:28.825928: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
Epoch 1/5
But the training never actually completes nor does it progress onto the next epoch. No errors are thrown, and no additional text/error messages are printed out to the console.
Have tried uninstalling and reinstalling tf and keras, as well as installing previous versions with no success. Additionally, my local machine has plenty of storage, so SSD/RAM is not the issue at play here. Genuinely no clue what to do here, no errors to go off of, hoping some ML expert on here has run into this problem before lol.
Thank you for reading!
Alex is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.