web-dev-qa-db-fra.com

AttributeError: le module 'tensorflow.python.keras.utils.generic_utils' n'a pas d'attribut 'populate_dict_with_module_objects'

Lorsque j'importe des keras, l'erreur ci-dessus apparaît même si cela fonctionnait bien hier.

Comment résoudre cette erreur?

Je travaille sous Windows 10 ma version keras est: 2.2.4 ma version tensorflow est: 2.2.0rc2

le suivi complet des erreurs est vu ci-dessous comme tel:

Traceback (most recent call last):

    from keras import models
  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\keras\__init__.py", line 3, in <module>

    from . import utils
  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\keras\utils\__init__.py", line 6, in <module>

    from . import conv_utils

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\keras\utils\conv_utils.py", line 9, in <module>

    from .. import backend as K

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\keras\backend\__init__.py", line 1, in <module>

    from .load_backend import epsilon

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\keras\backend\load_backend.py", line 90, in <module>

    from .tensorflow_backend import *

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\keras\backend\tensorflow_backend.py", line 5, in <module>

    import tensorflow as tf

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\__init__.py", line 41, in <module>

    from tensorflow.python.tools import module_util as _module_util
  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\__init__.py", line 84, in <module>

    from tensorflow.python import keras

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\__init__.py", line 27, in <module>

    from tensorflow.python.keras import models

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\models.py", line 24, in <module>

    from tensorflow.python.keras import metrics as metrics_module

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\metrics.py", line 37, in <module>

    from tensorflow.python.keras.engine import base_layer

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\engine\base_layer.py", line 51, in <module>

    from tensorflow.python.keras import initializers

  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\initializers\__init__.py", line 127, in <module>

    populate_deserializable_objects()
  File "C:\Users\world\AppData\Local\Programs\Python\Python38\lib\site-packages\tensorflow\python\keras\initializers\__init__.py", line 85, in populate_deserializable_objects
    generic_utils.populate_dict_with_module_objects(
AttributeError: module 'tensorflow.python.keras.utils.generic_utils' has no attribute 'populate_dict_with_module_objects'
2
amro_ghoneim

essayez de désinstaller tf-nightly package avec ce pip uninstall tf-nightly et vérifie python -c "import tensorflow". J'espère que cela résout le problème

0
vasista