一、问题

Traceback (most recent call last):
  File "video.py", line 9, in <module>
    ssd = SSD()
  File "/home/pi/Desktop/Mobilenet-SSD-Essay-master/ssd.py", line 37, in __init__
    self.sess = K.get_session()
AttributeError: module 'keras.backend' has no attribute 'get_session' 

原因:TensorFlow和 Keras 的版本太高导致的,我的版本如下:TensorFlow2.3.0、Keras2.4.3

二、解决方法

先定位到这行代码

from keras import backend as K 

改为

from tensorflow.compat.v1.keras import backend as K 
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐