im training a tcn model on my dataset :
# %%
from sklearn.preprocessing import StandardScaler
import pandas as pd
import numpy as np
from tensorflow import keras
import joblib
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import LSTM,Dense,Dropout
import os

# %%
csv_directory = r"C:\Users\arisa\Desktop\day_spot_summary"
csv_files = [file for file in os.listdir(csv_directory) if file.endswith('.csv')]

# %%
from tcn import TCN, tcn_full_summary  # Import TCN layer

def build_tcn_model(input_shape):
    model = Sequential([
        TCN(input_shape=input_shape, nb_filters=128, kernel_size=3, dilations=[1, 2, 4, 8], padding='causal',
            use_skip_connections=True, dropout_rate=0.2, return_sequences=False),
        # Dense(512, activation='relu'),
        # Dropout(0.2),
        # Dense(256, activation='relu'),
        # Dropout(0.2),
        Dense(128, activation='relu'),
        Dropout(0.1),
        Dense(64, activation='relu'),
        Dropout(0.1),
        Dense(32, activation='relu'),
        Dense(12),  # Assuming you have 12 targets as in your LSTM model
    ])

    model.compile(optimizer='adam',
                  loss='mse',  # Use Mean Squared Error for regression
                  metrics=['mae'])  # Mean Absolute Error as an additional metric
    return model

# %%
def data_generator_lstm( n_steps):
    
    while True:
        for csv_file in csv_files:
            # Read the CSV file
            file_path = os.path.join(csv_directory, csv_file)
            chunk = pd.read_csv(file_path)
        

            feature_data = chunk.drop([
                'y_High_1d', 'y_Low_1d', 'y_Priority_1d',
                 'y_High_2d', 'y_Low_2d', 'y_Priority_2d',
                  'y_High_3d', 'y_Low_3d', 'y_Priority_3d',
                   'y_High_5d', 'y_Low_5d', 'y_Priority_5d'], axis=1)
            target_data = chunk[['y_High_1d'
                   , 'y_Low_1d', 'y_Priority_1d',
                 'y_High_2d', 'y_Low_2d', 'y_Priority_2d',
                  'y_High_3d', 'y_Low_3d', 'y_Priority_3d',
                   'y_High_5d', 'y_Low_5d', 'y_Priority_5d'
                   ]]
            
            # Prepare sequences for features and targets
            X, y = [], []
            for i in range(len(feature_data) - n_steps + 1):  # Correct range to prevent out-of-bounds access
                X.append(feature_data.iloc[i:i + n_steps].to_numpy())  # Use iloc for consistency, though not necessary for slicing
                # Make sure the index for y is correctly bounded within the target_data
                if i + n_steps - 1 < len(target_data):  # Adjust condition to prevent out-of-bounds
                    y.append(target_data.iloc[i + n_steps - 1].to_numpy())  # Correct indexing to match the condition
                else:
                    break  # Safety break (though should be unnecessary with corrected logic) 
                
            X, y = np.array(X), np.array(y)
            yield X, y

# %%
from tensorflow.keras.mixed_precision import set_global_policy

# Enable mixed precision
set_global_policy('mixed_float16')

# %%


model = build_tcn_model((30, 2716,))

model.summary()




# %%
import warnings
warnings.filterwarnings(action='ignore', message='X has feature names, but StandardScaler was fitted without feature names')
train_generator = data_generator_lstm(30)

# Update total_samples, train_samples, and val_samples according to your dataset after transformations

model.fit(
    train_generator,
    steps_per_epoch=50,
    epochs=75,
    # Add validation_data if you have a validation generator
)




on the output it gives nan as mse and mae:
Epoch 1/75
50/50 [==============================] - 107s 2s/step - loss: nan - mae: nan
Epoch 2/75
33/50 [==================>...........] - ETA: 32s - loss: nan - mae: nan

is this ok?