Чем вызвана ошибка? Python (keras, mnist)

Код:

from keras.datasets import mnist
 
(train_X, train_y), (test_X, test_y) = mnist.load_data()
 
print('X_train: ' + str(train_X.shape))
print('Y_train: ' + str(train_y.shape))
print('X_test:  '  + str(test_X.shape))
print('Y_test:  '  + str(test_y.shape))

Ошибка:

2021-10-10 20:56:41.634944: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine.
Traceback (most recent call last):
  File "E:\Python\Scanner\Scanner_text_hard\Numbers\main.py", line 1, in <module>
    from keras.datasets import mnist
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\__init__.py", line 25, in <module>
    from keras import models
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\models.py", line 19, in <module>
    from keras import backend
  File "C:\Users\Matt\AppData\Local\Programs\Python\Python39\lib\site-packages\keras\backend.py", line 285, in <module>
    tf.__internal__.register_clear_session_function(clear_session)
AttributeError: module 'tensorflow.compat.v2.__internal__' has no attribute 'register_clear_session_function'
[Finished in 6.7s]```

Ответы (0 шт):