提交 5be4ed3d 编写于 作者: F François Chollet

Fix yaml version compat issue

上级 f2bbf98b
......@@ -639,7 +639,10 @@ def model_from_yaml(yaml_string, custom_objects=None):
# Returns
A Keras model instance (uncompiled).
"""
config = yaml.load(yaml_string, Loader=yaml.FullLoader)
if hasattr(yaml, 'FullLoader'):
config = yaml.load(yaml_string, Loader=yaml.FullLoader)
else:
config = yaml.load(yaml_string)
from ..layers import deserialize
return deserialize(config, custom_objects=custom_objects)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册