" ValueError:不支持任何值" skflow示例中的neural_translation.py

时间:2016-04-29 03:22:43

标签: tensorflow skflow

我的环境是

  • Mac OS X 10.11.4
  • Python 2.7
  • Tensorflow 0.8

我刚下来并在tensorflow中运行一个skflow示例。 示例是neural_translation.py

$ curl -O https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/skflow/neural_translation.py
$ curl -O http://www.statmt.org/europarl/v6/fr-en.tgz
$ tar xvfz fr-en.tgz
...
$ python neural_translation.py

但是上面给出了以下错误。

Traceback (most recent call last):
  File "neural_translation.py", line 121, in <module>
    translator.fit(x_iter, y_iter, logdir=PATH)
  File "/Library/Python/2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/base.py", line 227, in fit
    self._setup_training()
  File "/Library/Python/2.7/site-packages/tensorflow/contrib/learn/python/learn/estimators/base.py", line 163, in _setup_training
    optimizer=optimizer, clip_gradients=self.clip_gradients)
  File "/Library/Python/2.7/site-packages/tensorflow/contrib/layers/python/layers/optimizers.py", line 141, in optimize_loss
    logging_ops.histogram_summary(variable.name + "/gradients", grad_values)
  File "/Library/Python/2.7/site-packages/tensorflow/python/ops/logging_ops.py", line 113, in histogram_summary
    tag=tag, values=values, name=scope)
  File "/Library/Python/2.7/site-packages/tensorflow/python/ops/gen_logging_ops.py", line 55, in _histogram_summary
    name=name)
  File "/Library/Python/2.7/site-packages/tensorflow/python/ops/op_def_library.py", line 415, in apply_op
    as_ref=input_arg.is_ref).dtype.name
  File "/Library/Python/2.7/site-packages/tensorflow/python/framework/ops.py", line 566, in convert_to_tensor
    ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
  File "/Library/Python/2.7/site-packages/tensorflow/python/ops/constant_op.py", line 179, in _constant_tensor_conversion_function
    return constant(v, dtype=dtype, name=name)
  File "/Library/Python/2.7/site-packages/tensorflow/python/ops/constant_op.py", line 162, in constant
    tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
  File "/Library/Python/2.7/site-packages/tensorflow/python/framework/tensor_util.py", line 325, in make_tensor_proto
    raise ValueError("None values not supported.")
ValueError: None values not supported.

任何人都知道如何解决此错误?提前谢谢。

0 个答案:

没有答案