I had the same problem when using Keras on my MacBook Pro M1 Pro. Downgrading the Keras version to 3.4 worked for me.