Tensorflow 在google colab上使用带keras 2.4.3的掩码rcnn

Tensorflow 在google colab上使用带keras 2.4.3的掩码rcnn,tensorflow,keras,computer-vision,google-colaboratory,image-segmentation,Tensorflow,Keras,Computer Vision,Google Colaboratory,Image Segmentation,我正在尝试在colab上运行Mask rcnn以检测金属缺陷()。colab的Keras版本为2.4.3,而存储库Keras版本为2.1.3。我在加载权重时遇到以下错误: model.load_weights(model_path, by_name=True, exclude=EXCLUDE_LAYER_WEIGHTS): AttributeError Traceback (most recent call last) <ipython

我正在尝试在colab上运行Mask rcnn以检测金属缺陷()。colab的Keras版本为2.4.3,而存储库Keras版本为2.1.3。我在加载权重时遇到以下错误:

model.load_weights(model_path, by_name=True, exclude=EXCLUDE_LAYER_WEIGHTS):
AttributeError                            Traceback (most recent call last)
<ipython-input-2-a24cb8cfa577> in <module>()
----> 1 model.load_weights(model_path, by_name=True, exclude=EXCLUDE_LAYER_WEIGHTS)

/content/drive/My Drive/Colab Notebooks/metal-defect-detection/model.py in load_weights(self, filepath, by_name, exclude)
   2030 
   2031         if by_name:
-> 2032             topology.load_weights_from_hdf5_group_by_name(f, layers)
   2033 
   2034         else:

AttributeError: module 'keras.engine.topology' has no attribute 'load_weights_from_hdf5_group_by_name'
model.load\u权重(model\u路径,by\u name=True,exclude=exclude\u LAYER\u权重):
AttributeError回溯(最近一次呼叫上次)
在()
---->1模型。加载权重(模型路径,按名称=真,排除=排除层权重)
/content/drive/My drive/Colab笔记本电脑/金属缺陷检测/model.py加载权重(self、filepath、by_name、exclude)
2030
2031如果按名称:
->2032拓扑。按名称(f,层)从组中加载权重
2033
2034其他:
AttributeError:模块“keras.engine.topology”没有“按名称从组中加载权重”属性
我尝试了一些在线建议的解决方案,比如:用保存替换拓扑,但我有同样的问题。有一种方法可以更改代码,以便在keras 2.4.3中使用此类存储库