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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值