提交 9e0997ad 编写于 作者: W Waleed Abdulla

Fix load_weights() for Keras versions before 2.2

Improve previous commit to not break on older versions of Keras.
上级 7a94c890
......@@ -2094,7 +2094,13 @@ class MaskRCNN():
exlude: list of layer names to excluce
"""
import h5py
from keras.engine import saving
# Conditional import to support versions of Keras before 2.2
# TODO: remove in about 6 months (end of 2018)
try:
from keras.engine import saving
except ImportError:
# Keras before 2.2 used the 'topology' namespace.
from keras.engine import topology as saving
if exclude:
by_name = True
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册