在训练yolov3框架时,总是存在此模块错误

我尝试过重新安装keras和tensorflow,而keras的版本是2.3.0,而tensorflow的版本是1.14.0。

Traceback (most recent call last):
  File "train.py", line 6, in <module>
    import keras.backend as K
  File "F:\Anacoda\lib\site-packages\keras\__init__.py", line 3, in <module>
    from . import utils
  File "F:\Anacoda\lib\site-packages\keras\utils\__init__.py", line 27, in <module>
    from .multi_gpu_utils import multi_gpu_model
  File "F:\Anacoda\lib\site-packages\keras\utils\multi_gpu_utils.py", line 7, in <module>
    from ..layers.merge import concatenate
  File "F:\Anacoda\lib\site-packages\keras\layers\__init__.py", line 4, in <module>
    from ..engine.base_layer import Layer
  File "F:\Anacoda\lib\site-packages\keras\engine\__init__.py", line 8, in <module>
    from .training import Model
  File "F:\Anacoda\lib\site-packages\keras\engine\training.py", line 21, in <module>
    from . import training_arrays
  File "F:\Anacoda\lib\site-packages\keras\engine\training_arrays.py", line 14, in <module>
    from .. import callbacks as cbks
  File "F:\Anacoda\lib\site-packages\keras\callbacks\__init__.py", line 19, in <module>
    if K.backend() == 'tensorflow' and not K.tensorflow_backend._is_tf_1():
AttributeError: module 'keras.backend.tensorflow_backend' has no attribute '_is_tf_1'

最佳答案

pip3 uninstall keras
pip3 install keras --upgrade



https://github.com/keras-team/keras/issues/13352

07-24 09:53
查看更多