tensorflow.python.framework.errors_impl.AlreadyExistsError解决方案

2023-05-16

tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.
这是tensorflow.keras和keras和tensorflow.python.keras的兼容问题
原本跟的代码为

from keras.layers import Input, Add, Conv2D, MaxPooling2D, UpSampling2D, Reshape
from keras.models import Model

改为下面这样就解决了,注意是tensorflow.python.keras不是tensorflow.keras!

from tensorflow.python.keras.layers import Input, Add, Conv2D, MaxPooling2D, UpSampling2D, Reshape
from tensorflow.python.keras.models import Model
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

tensorflow.python.framework.errors_impl.AlreadyExistsError解决方案 的相关文章

随机推荐