title: AttributeError: module 'tensorflow_core.compat.v2' has no attribute '__internal__'
body: <pre><code>import keras
  from keras.datasets import mnist
  from keras.models import Sequential
  from keras.layers import Dense
  from keras.optimizers import SGD
  import matplotlib.pyplot as plt
  
  (x_train, y_train), (x_test, y_test) = mnist.load_data()
  
  print(x_train.shape, y_train.shape)
  print(x_test.shape, y_test.shape)
  
  im = plt.imshow(x_train[0], cmap=&quot;gray&quot;)
  plt.show()
  
  
  x_train = x_train.reshape(60000, 784)
  x_test = x_test.reshape(10000, 784)
  
  x_train = x_train/255
  x_test = x_test/255
  
  y_train = keras.utils.to_categorical(y_train, 10)
  y_test = keras.utils.to_categorical(y_test, 10)
  
  model = Sequential()
  model.add(Dense(512, activation='relu', input_shape=(784,)))
  model.add(Dense(256, activation='relu'))
  model.add(Dense(10, activation='softmax'))
  model.summary()
  
  model.compile(optimizer=SGD(), loss='categorical_crossentropy', metics=['accuracy'])
  model.fit(x_train, y_train, batch_size=64, epochs=5, validation_data=(x_test, y_test))
  </code></pre>
  <p>I tried several different versions of the combination, but still reported an error about
  AttributeError: module 'tensorflow_core.compat.v2' has no attribute '<strong>internal</strong>'</p>