Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/346.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python TensorFlow translate.py教程已经完成_Python_Tensorflow_Translate_Cudnn - Fatal编程技术网

Python TensorFlow translate.py教程已经完成

Python TensorFlow translate.py教程已经完成,python,tensorflow,translate,cudnn,Python,Tensorflow,Translate,Cudnn,请参见代码块末尾的值错误。运行翻译教程时发生此错误。你知道为什么会这样吗?我正在运行python3,CUDA和CuDNN安装正确。我能够根据安装说明验证TensorFlow的安装,因此CuDNN/CUDA的基本功能应该可以正常工作。我正在Ubuntu 16.04上使用python3 最近使用翻译教程的其他人是否有此问题?当我假设本教程适用于其他人时,你知道我为什么会有这个问题吗 `(tensorflow) nathan@nathan1:~/repos/tensorflow/models/tuto

请参见代码块末尾的值错误。运行翻译教程时发生此错误。你知道为什么会这样吗?我正在运行python3,CUDA和CuDNN安装正确。我能够根据安装说明验证TensorFlow的安装,因此CuDNN/CUDA的基本功能应该可以正常工作。我正在Ubuntu 16.04上使用python3

最近使用翻译教程的其他人是否有此问题?当我假设本教程适用于其他人时,你知道我为什么会有这个问题吗

`(tensorflow) nathan@nathan1:~/repos/tensorflow/models/tutorials/rnn/translate$ python3 translate.py --data_dir ~/data/tensorflow/translate/

Preparing WMT data in /home/nathan/data/tensorflow/translate/
2017-05-16 22:18:50.664841: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.1 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-16 22:18:50.664859: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use SSE4.2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-16 22:18:50.664864: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2017-05-16 22:18:50.664868: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2017-05-16 22:18:50.664872: W tensorflow/core/platform/cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use FMA instructions, but these are available on your machine and could speed up CPU computations.
2017-05-16 22:18:50.665996: E tensorflow/stream_executor/cuda/cuda_driver.cc:405] failed call to cuInit: CUDA_ERROR_UNKNOWN
2017-05-16 22:18:50.666149: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:158] retrieving CUDA diagnostic information for host: nathan1
2017-05-16 22:18:50.666157: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165] hostname: nathan1
2017-05-16 22:18:50.666177: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189] libcuda reported version is: 375.66.0
2017-05-16 22:18:50.666323: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:369] driver version file contents: """NVRM version: NVIDIA UNIX x86_64 Kernel Module  375.66  Mon May  1 15:29:16 PDT 2017
GCC version:  gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 
"""
2017-05-16 22:18:50.666338: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193] kernel reported version is: 375.66.0
2017-05-16 22:18:50.666343: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:300] kernel version seems to match DSO: 375.66.0
Creating 3 layers of 1024 units.
Traceback (most recent call last):
  File "translate.py", line 322, in <module>
    tf.app.run()
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/python/platform/app.py", line 48, in run
    _sys.exit(main(_sys.argv[:1] + flags_passthrough))
  File "translate.py", line 319, in main
    train()
  File "translate.py", line 178, in train
    model = create_model(sess, False)
  File "translate.py", line 136, in create_model
    dtype=dtype)
  File "/home/nathan/repos/tensorflow/models/tutorials/rnn/translate/seq2seq_model.py", line 179, in __init__
    softmax_loss_function=softmax_loss_function)
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 1201, in model_with_buckets
    decoder_inputs[:bucket[1]])
  File "/home/nathan/repos/tensorflow/models/tutorials/rnn/translate/seq2seq_model.py", line 178, in <lambda>
    lambda x, y: seq2seq_f(x, y, False),
  File "/home/nathan/repos/tensorflow/models/tutorials/rnn/translate/seq2seq_model.py", line 142, in seq2seq_f
    dtype=dtype)
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/legacy_seq2seq/python/ops/seq2seq.py", line 855, in embedding_attention_seq2seq
    encoder_cell, encoder_inputs, dtype=dtype)
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 197, in static_rnn
    (output, state) = call_cell()
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn.py", line 184, in <lambda>
    call_cell = lambda: cell(input_, state)
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 881, in __call__
    return self._cell(embedded, state)
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 953, in __call__
    cur_inp, new_state = cell(cur_inp, cur_state)
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 146, in __call__
    with _checked_scope(self, scope or "gru_cell", reuse=self._reuse):
  File "/usr/lib/python3.5/contextlib.py", line 59, in __enter__
    return next(self.gen)
  File "/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/rnn/python/ops/core_rnn_cell_impl.py", line 77, in _checked_scope
    type(cell).__name__))
ValueError: Attempt to reuse RNNCell <tensorflow.contrib.rnn.python.ops.core_rnn_cell_impl.GRUCell object at 0x7f0b66e04b70> with a different variable scope than its first use.  First use of cell was with scope 'embedding_attention_seq2seq/embedding_attention_decoder/attention_decoder/multi_rnn_cell/cell_0/gru_cell', this attempt is with scope 'embedding_attention_seq2seq/rnn/multi_rnn_cell/cell_0/gru_cell'.  Please create a new instance of the cell if you would like it to use a different set of weights.  If before you were using: MultiRNNCell([GRUCell(...)] * num_layers), change to: MultiRNNCell([GRUCell(...) for _ in range(num_layers)]).  If before you were using the same cell instance as both the forward and reverse cell of a bidirectional RNN, simply create two instances (one for forward, one for reverse).  In May 2017, we will start transitioning this cell's behavior to use existing stored weights, if any, when it is called with scope=None (which can lead to silent model degradation, so this error will remain until then.` 
`(tensorflow)nathan@nathan1:~/repos/tensorflow/models/tutorials/rnn/translate$python3 translate.py--data\u dir~/data/tensorflow/translate/
在/home/nathan/data/tensorflow/translate中准备WMT数据/
2017-05-16 22:18:50.664841:W tensorflow/core/platform/cpu_feature_guard.cc:45]tensorflow库的编译不是为了使用SSE4.1指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-05-16 22:18:50.664859:W tensorflow/core/platform/cpu_feature_guard.cc:45]tensorflow库的编译不是为了使用SSE4.2指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-05-16 22:18:50.664864:W tensorflow/core/platform/cpu\u feature\u guard.cc:45]tensorflow库的编译不是为了使用AVX指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-05-16 22:18:50.664868:W tensorflow/core/platform/cpu_feature_guard.cc:45]tensorflow库的编译不是为了使用AVX2指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-05-16 22:18:50.664872:W tensorflow/core/platform/cpu\u feature\u guard.cc:45]tensorflow库的编译不是为了使用FMA指令,但这些指令在您的机器上可用,可以加快cpu计算。
2017-05-16 22:18:50.665996:E tensorflow/stream_executor/cuda/cuda_driver.cc:405]调用cuInit失败:cuda_错误未知
2017-05-16 22:18:50.666149:I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:158]检索主机nathan1的cuda诊断信息
2017-05-16 22:18:50.666157:I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:165]主机名:nathan1
2017-05-16 22:18:50.666177:I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:189]libcuda报告版本为:375.66.0
2017-05-16 22:18:50.666323:I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:369]驱动程序版本文件内容:“NVRM版本:NVIDIA UNIX x86_64内核模块375.66 Mon May 1 15:29:16 PDT 2017
GCC版本:GCC版本5.4.0 20160609(Ubuntu 5.4.0-6ubuntu1~16.04.4)
"""
2017-05-16 22:18:50.666338:I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:193]内核报告版本为:375.66.0
2017-05-16 22:18:50.666343:I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:300]内核版本似乎与DSO:375.66.0匹配
创建3层1024个单元。
回溯(最近一次呼叫最后一次):
文件“translate.py”,第322行,在
tf.app.run()
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/python/platform/app.py”,第48行,正在运行
_系统出口(主(_sys.argv[:1]+标志_passthrough))
文件“translate.py”,第319行,在main中
列车()
列中第178行的文件“translate.py”
模型=创建模型(sess,False)
文件“translate.py”,第136行,在create_模型中
dtype=dtype)
文件“/home/nathan/repos/tensorflow/models/tutorials/rnn/translate/seq2seq_model.py”,第179行,在__
softmax_损耗函数=softmax_损耗函数)
文件“/home/nathan/.local/lib/python3.5/site-packages/tensorflow/contrib/legacy_-seq2seq/python/ops/seq2seq.py”,第1201行,模型_中带_-bucket
解码器_输入[:bucket[1]])
文件“/home/nathan/repos/tensorflow/models/tutorials/rnn/translate/seq2seq_model.py”,第178行,在
λx,y:seq2seq_f(x,y,False),
文件“/home/nathan/repos/tensorflow/models/tutorials/rnn/translate/seq2seq_model.py”,第142行,在seq2seq_f中
dtype=dtype)
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/contrib/legacy_-seq2seq/python/ops/seq2seq.py”,第855行,嵌入_-seq2seq
编码器\单元,编码器\输入,dtype=dtype)
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/contrib/rnn/python/ops/core\u rnn.py”,第197行,静态
(输出,状态)=调用单元()
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/contrib/rnn/python/ops/core_rnn.py”,第184行,in
call_cell=lambda:cell(输入_,状态)
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/contrib/rnn/python/ops/core\n\u cell\u impl.py”,第881行,在调用中__
返回自存储单元(嵌入式,状态)
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/contrib/rnn/python/ops/core\n\u cell\u impl.py”,第953行,在调用中__
电流输入,新状态=单元(电流输入,电流状态)
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/contrib/rnn/python/ops/core\u rnn\u cell\u impl.py”,调用中的第146行__
选中范围(self、scope或“gru单元”,重用=self.\u重用):
文件“/usr/lib/python3.5/contextlib.py”,第59行,输入__
返回下一个(self.gen)
文件“/home/nathan/.local/lib/python3.5/site packages/tensorflow/contrib/rnn/python/ops/core\n\u cell\u impl.py”,第77行,在检查范围内
类型(单元格)。\uuuuu名称(单元格))
ValueError:尝试使用不同于第一次使用的变量范围重新使用RNNCell。第一次使用cell是在范围“Embedded_attention_seq2seq/Embedded_attention_decoder/attention_decoder/multi_rnn_cell/cell_0/gru_cell”中,这一尝试是在范围“Embedded_attention_seq2seq/rnn/multi_rnn_cell/cell_0/gru_cell”中进行的。如果希望单元格使用不同的权重集,请创建一个新的单元格实例。如果在使用:MultiRNNCell([GRUCell(…)]*num\u层)之前,请更改为:MultiRNNCell([GRUCell(…)表示范围内的(num\u层)]。如果在使用同一个cel之前
rnn_cell = tf.contrib.rnn.LSTMCell(300)

output, _ = tf.nn.bidirectional_dynamic_rnn(rnn_cell, rnn_cell, data, dtype = tf.float32)

#^^^^allowed before but not now

fw_rnn_cell = tf.contrib.rnn.LSTMCell(300)
bw_rnn_cell = tf.contrib.rnn.LSTMCell(300)
output, _ = tf.nn.bidirectional_dynamic_rnn(fw_rnn_cell, bw_rnn_cell, data, dtype = tf.float32)

#^^^^allowed now

#Another example

rnn_cell = tf.contrib.rnn.LSTMCell(300)
output_layer_1, _ = tf.nn.dynamic_rnn(rnn_cell, data, dtype = tf.float32, scope = "rnn_layer_1")
output_layer_2, _ = tf.nn.dynamic_rnn(rnn_cell, output_layer_1, dtype = tf.float32, scope = "rnn_layer_2")

#^^^^allowed before but not now

rnn_cell_1 = tf.contrib.rnn.LSTMCell(300)
output_layer_1, _ = tf.nn.dynamic_rnn(rnn_cell_1, data, dtype = tf.float32, scope = "rnn_layer_1")
rnn_cell_2 = tf.contrib.rnn.LSTMCell(300)
output_layer_2, _ = tf.nn.dynamic_rnn(rnn_cell_2, output_layer_1, dtype = tf.float32, scope = "rnn_layer_2")

#^^^^allowed now