bert运行报错: ‘tensorflow.contrib.tpu‘ has no attribute ‘InputPipelineConfig‘(无需降版本)

 参考文献:tensorflow官方文档

链接:https://tensorflow.google.cn/versions/r1.15/api_docs/python/tf/contrib?hl=en

先导入以下代码:

import tensorflow as tf
# import tensorflow.compat.v1 as tf
tf.compat.v1.disable_eager_execution()

再将出错的代码改为如下所示:

tf.compat.v1.estimator.tpu.InputPipelineConfig

完工。

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