GameOfThrows
GameOfThrows

Reputation: 4510

skflow example throws errors

I'm quite new to python and skflow, but I am experiencing a really basic problem and hope someone could help me.

I've installed skflow and downloaded the dbpedia_csv which is used in the examples. However upon running the 'text_classification_character_rnn.py' example, I am hit with an error:

Traceback (most recent call last):
File "/home/me/Projects/skflow/examples/text_classification_character_rnn.py", line 70, in <module>
classifier.fit(X_train, y_train)
 File "/home/me/Projects/skflow/skflow/estimators/base.py", line 217, in fit
self._setup_training()
File "/home/me/Projects/skflow/skflow/estimators/base.py", line 148, in _setup_training
self._inp, self._out)
File "/home/me/Projects/skflow/examples/text_classification_character_rnn.py", line 63, in char_rnn_model
return skflow.models.logistic_regression(encoding, y)
File "/home/me/Projects/skflow/skflow/models.py", line 65, in logistic_regression
tf.histogram_summary('logistic_regression.X', X)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/summary_ops.py", line 39, in histogram_summary
tag=tag, values=values, name=scope)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_summary_ops.py", line 34, in _histogram_summary
name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/op_def_library.py", line 397, in apply_op
values, name=input_arg.name, dtype=dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py", line 468, in convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/constant_op.py", line 143, in constant
tensor_util.make_tensor_proto(value, dtype=dtype, shape=shape))
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 287, in make_tensor_proto
_AssertCompatible(values, dtype)
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/tensor_util.py", line 227, in _AssertCompatible
(dtype.name, mismatch))
TypeError: Expected float32, got <tensorflow.python.framework.ops.Tensor object at 0x7f415dfcc290> instead.

Any ideas on what I am doing wrong? Also, the text_classification_cnn.py is working, but the print('Accuracy: {0:f}'.format(score)) no accuracy is printed. I'm using PyCharm Edu 2.0.3 to run the code.

Upvotes: 0

Views: 251

Answers (1)

mrry
mrry

Reputation: 126154

This looks like a version mismatch between skflow and TensorFlow. From the error message, it looks like you have an old version (0.5 or 0.6) of TensorFlow. However, skflow was recently updated to use a new interface in TensorFlow, and it looks like you are using this latest version of skflow.

The simplest solution would be to upgrade TensorFlow to version 0.7.1

Upvotes: 2

Related Questions