Getting some issues related to tensorflow (2.5.0) on MacOS with M1 chip

I am trying the following text Classification code from François Chollet’s Deep Learning Book on MacOS BigSur M1 Chip (Version 11.2.3) for the first time. I am using tensorflow version 2.5.0

import tensorflow as tf
from tensorflow.keras import layers
from tensorflow.keras.datasets import imdb
from tensorflow.keras.preprocessing import sequence
max_features = 2000
max_len = 500
(x_train, y_train), (x_test, y_test) = imdb.load_data(num_words=max_features)
x_train = sequence.pad_sequences(x_train, maxlen=max_len)
x_test = sequence.pad_sequences(x_test, maxlen=max_len)
model = keras.models.Sequential()
model.add(layers.Embedding(max_features, 128,input_length=max_len,name='embed'))
model.add(layers.Conv1D(32, 7, activation='relu'))
model.add(layers.Conv1D(32, 7, activation='relu'))

history =, y_train, epochs=20, batch_size=128,

Why these accuracy and loss values are very high. I am getting different values, if I run the same code on Windows 10.

Results on MacOS:

Results on Windows 10:

Even running any other code, using Adam’s Optimizer, I am getting a notice that Kernel appears to have died.

Results on MacOS:

And how to avoid these warnings (in pink box)?

Please help!!