bert运行报错: AttributeError: module 'tensorflow.contrib.tpu' has no attribute 'InputPipelineConfig'

bert的例子在GPU上执行时报错:

BERT-Classification-Tutorial → master$ sh run_classifier.sh 
/opt/miniconda3/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6
  return f(*args, **kwds)
WARNING:tensorflow:Flag task_name has a non-None default value; therefore, mark_flag_as_required will pass even if flag is not specified in the command line!
Traceback (most recent call last):
  File "run_classifier.py", line 929, in 
    tf.app.run()
  File "/opt/miniconda3/lib/python3.6/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "run_classifier.py", line 783, in main
    is_per_host = tf.contrib.tpu.InputPipelineConfig.PER_HOST_V2
AttributeError: module 'tensorflow.contrib.tpu' has no attribute 'InputPipelineConfig'

搜到的解决方案: https://github.com/google-research/bert/issues/49
看来是跑bert的话得用 tf 1.11           
 pip install --upgrade tensorflow-gpu==1.11

但是会出现新的问题:ImportError: libcublas.so.9.0: cannot open shared object file: No such file or directory
解决方案:  https://blog.csdn.net/zzldm/article/details/81630267 

你可能感兴趣的:(NLP,AI,DL)