tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name

tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name: EagerVariableNameReuse解决方案。

tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name
问题原因:安装了TensorFlow·2.3.0版本
解决方案:pip install -U tensorflow-gpu ==2.1.0

运用上面的代码,重新安装tensorflow 2.1.0 版本就行了。(本人装的是GPU版本,大家如果装的是CPU版本,可以用这个命令:pip install -U tensorflow== 2.1.0

tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name
以上安装命令,安装完tensorflow==2.1.0版本后,会自动卸载已安装的其它版本。

然后重新运行原先会报错的代码,发现就可以运行了,不会在报错。搞定!!
tensorflow.python.framework.errors_impl.InvalidArgumentError: assertion failed: [0] [Op:Assert] name