tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.

在tensorflow2.6环境下,调用命令

import tensorflow as tf
lstm = tf.keras.layers.LSTM(4)

报错tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.
查看了conda环境下的包版本,当前状态为tensorflow==2.6.0keras==2.7.0,经过其他大佬的解答,最终得出解决方案
卸载当前keras,再重新安装keras==2.6.0

pip uninstall keras
pip install keras==2.6.0

就OKK!!!

Logo

汇聚全球AI编程工具,助力开发者即刻编程。

更多推荐