Tensorflow-gpu配置

     为了运行BiDAF模型的代码,配置TensorFlow环境。一开始下载了TensorFlow1.12,运行时显示

        module 'tensorflow.contrib.rnn.python.ops.rnn_cell' has no attribute '_linear'

看了下TensorFlow源码发现根本没有_linear这个函数。通过附录1,又看了源码的环境,发现要在TensorFlow1.2环境下运行。

(为什么新的不兼容老版本呢???)

然后就装上1.2版本,不过gpu版本无法运行,会出现下面的错。查了些资料得知1.2版本对应的cuda版本为8.0,我装的cuda9.2,唉,又花了些时间装cuda8.0和cuDnn5.1,终于能import TensorFlow了。不过代码还没有运行,明天再弄吧。

 

         想起来之前配置Theano时,可以在cpu下运行,gpu无法运行,显示Exception: The nvidia driver version installed with this OS does not give good results for reduction.Installing the nvidia driver available on the same download page as the cuda package will fix the problem。 驱动程序不匹配??也不知道怎么解决

        

ImportError: No module named '_pywrap_tensorflow_internal'


Failed to load the native TensorFlow runtime.

See https://www.tensorflow.org/install/install_sources#common_installation_problems

for some common reasons and solutions.  Include the entire stack trace
above this error message when asking for help.

附录1.https://github.com/da03/Attention-OCR/issues/71

附录2.https://stackoverflow.com/questions/43942185/failed-to-load-the-native-tensorflow-runtime-python-3-5-2

附录3.模型代码https://github.com/allenai/bi-att-flow

你可能感兴趣的:(DeepLearning)