"ValueError: None values not supported" of neural_translation.py in skflow examples

1.8k Views Asked by At

My environment is

  • Mac OS X 10.11.4
  • Python 2.7
  • Tensorflow 0.8

I just down and run a skflow example in tensorflow. The example is 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

But the above give the following error.

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.

Anyone has any idea on how to solve this error? Thank you in advance.

0

There are 0 best solutions below