Failed to get CPU frequency: 0 Hz

I,

I want to run this program :

def model(activation):
model = keras.Sequential([
keras.layers.Flatten(input_shape=(28, 28)),
keras.layers.Dense(100, activation=activation, bias_initializer=‘RandomNormal’, kernel_initializer=‘RandomNormal’),
keras.layers.Dense(10, activation=‘softmax’, bias_initializer=‘RandomNormal’, kernel_initializer=‘RandomNormal’)
])
# Compile the model
model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=1e-5),
loss=‘categorical_crossentropy’,
metrics=[‘categorical_accuracy’]
)

# Train the model
model.fit(x_train, y_train, batch_size=32, epochs=100, verbose=2)
loss, acc = model.evaluate(x_test, y_test)
return acc

but i get this warning:
Failed to get CPU frequency: 0 Hz

the training of my neural network is very slow (14s/epoch)…

How can i fix that ?

thx

Hi @Rickem, Could you please confirm whether you are trying to execute the code in the Apple M1? If yes the issue is with Apple M1 and not with Tensorflow.

Could you please post this issue in the Apple developer forum Apple Developer Forums for quick assistance.

Thank you.

Yes, I execute the program with an Apple M1 pro.

Thank you