运行RNN的Tensorflow示例

时间:2016-11-09 15:55:17

标签: python-2.7 tensorflow deep-learning recurrent-neural-network

我尝试按照here所述运行代码。 我有一个anaconda环境,通过pip安装安装了tensorflow。

尝试在提供的链接上运行示例时,我遇到了问题。第一个是我的安装中没有文件:ptb_word_lm.py 。我只是从github复制了文件并试图运行。运行python ptb_word_lm.py --data_path=/tmp/simple-examples/data/ --model small

时出现以下错误

错误消息:

I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcublas.so locally
I tensorflow/stream_executor/dso_loader.cc:105] Couldn't open CUDA library libcudnn.so. LD_LIBRARY_PATH: /lib/x86_64-linux-gnu:/home/danielmoreira/anaconda2:/home/danielmoreira/anaconda2/lib:/usr/local/cuda-7.5/lib64:
I tensorflow/stream_executor/cuda/cuda_dnn.cc:3448] Unable to load cuDNN DSO
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcufft.so locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcuda.so.1 locally
I tensorflow/stream_executor/dso_loader.cc:111] successfully opened CUDA library libcurand.so locally
Traceback (most recent call last):
  File "ptb_word_lm.py", line 361, in <module>
    tf.app.run()
  File "/home/danielmoreira/anaconda2/envs/tensorenv/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 30, in run
    sys.exit(main(sys.argv[:1] + flags_passthrough))
  File "ptb_word_lm.py", line 321, in main
    train_input = PTBInput(config=config, data=train_data, name="TrainInput")
  File "ptb_word_lm.py", line 85, in __init__
    self.input_data, self.targets = reader.ptb_producer(
AttributeError: 'module' object has no attribute 'ptb_producer'

我发现Google上的人建议将行from tensorflow.models.rnn.ptb import reader更改为import reader,但它似乎对我不起作用。

有谁知道可能的解决方案? 我使用的是 Python 2.7.12 ,而Tensorflow版本似乎 0.11.0rc2

0 个答案:

没有答案