Failed to get CPU frequency: 0 Hz

I am performing a grid search over a parameter grid and train the model with different combinations of hyperparameters. I am receiving the following Warning:

W tensorflow/tsl/platform/profile_utils/cpu_utils.cc:128] Failed to get CPU frequency: 0 Hz

Why is that and what can I do to fix it?

Thank you very much.

Here is the code:

def grid_search(model_name):
...
  elif model_name == 'LSTM':
    def build_model(units, activation, dropout, layers):
        model = Sequential()
        model.add(LSTM(units=units, kernel_initializer="normal", activation=activation, return_sequences=True, input_shape=(2, 1152), recurrent_dropout=0))
        model.add(Dropout(dropout))
        for i in range(layers):
            if i != layers-1:
                model.add(LSTM(units=units, kernel_initializer="normal", activation=activation, return_sequences=True,recurrent_dropout=0))
                model.add(Dropout(dropout))
            elif i == (layers-1):
                model.add(LSTM(units=units, kernel_initializer="normal", activation=activation, recurrent_dropout=0))
                model.add(Dropout(dropout))
        model.add(Dense(units=6, kernel_initializer="normal", activation=activation))
        model.compile(optimizer="adam", loss="sparse_categorical_crossentropy", metrics=["accuracy"])
        return model

param_grid = {'units': [200, 300, 400],
              'activation': ['tanh'],
              'dropout': [0, 0.2, 0.4, 0.6],
              'layers': [0, 5]}

group_kfold = GroupKFold(n_splits=len(np.unique(groups_train)))

model = KerasClassifier(model=build_model, units=param_grid['units'], activation=param_grid['activation'], dropout=param_grid['dropout'], layers=param_grid['layers'])

grid_search = GridSearchCV(estimator=model, param_grid=param_grid, cv=group_kfold)

X_test, X_train, y_test, y_train = raw_dataassigner(model_name)
(X_train, y_train) = shuffle(X_train, y_train)

with tf.device('/cpu:0'):
    grid_result = grid_search.fit(X_train, y_train, groups=groups_train)

print(f'Best score ({grid_search.best_score_}) for {model_name} model achieved with parameters: ', grid_search.best_params_)
means = grid_result.cv_results_['mean_test_score']
stds = grid_result.cv_results_['std_test_score']
params = grid_result.cv_results_['params']
for mean, stdev, param in zip(means, stds, params):
    print("%f (%f) with: %r" % (mean, stdev, param))

grid_search('LSTM')