eval is not supported when eager execution is enabled

我tensorflow_gpu版本是2.1.0;报如下错误:
NotImplementedError: eval is not supported when eager execution is enabled, is .numpy() what you’re looking for?
在引入tensorflow包后,加上这句:

tf.compat.v1.disable_eager_execution()

你可能感兴趣的:(踩过的坑,tensorflow,深度学习)