问题描述:
tensorflow2.1 搭建模型时报以下错误
ValueError: tf.function-decorated function tried to create variables on non-first call.
原因分析:
https://www.it610.com/article/1294519124508090368.htm
https://blog.csdn.net/weixin_43824178/article/details/99297237
解决方案:
在model.compile()前加上以下代码,即可。
tf.config.experimental_run_functions_eagerly(True)