You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I got an error while running the example of Random Forest.
And I don't know what causes it. Maybe the version of TensorFlow?
My environment is Python 3.6.3 + TensorFlow 1.4.0 on Mac 10.13.1
Error:
/Users/sakigami/anaconda/bin/python /Users/sakigami/programmer/Python/tf_study/02_basic_models/random_forest.py
Extracting ../MNIST_data/train-images-idx3-ubyte.gz
Extracting ../MNIST_data/train-labels-idx1-ubyte.gz
Extracting ../MNIST_data/t10k-images-idx3-ubyte.gz
Extracting ../MNIST_data/t10k-labels-idx1-ubyte.gz
Traceback (most recent call last):
File "/Users/sakigami/programmer/Python/tf_study/02_basic_models/random_forest.py", line 36, in
correct_prediction = tf.equal(tf.argmax(infer_op, 1), tf.cast(Y, tf.string))
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 316, in new_func
return func(*args, **kwargs)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 205, in argmax
return gen_math_ops.arg_max(input, axis, name=name, output_type=output_type)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 441, in arg_max
name=name)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 513, in _apply_op_helper
raise err
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
preferred_dtype=default_dtype)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 926, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 970, in _autopacking_conversion_function
return _autopacking_helper(v, inferred_dtype, name or "packed")
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 912, in _autopacking_helper
elem))
TypeError: Cannot convert a list containing a tensor of dtype <dtype: 'string'> to <dtype: 'float32'> (Tensor is: <tf.Tensor 'stack_2:0' shape=(?, 10) dtype=string>)
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
I got an error while running the example of Random Forest.
And I don't know what causes it. Maybe the version of TensorFlow?
My environment is Python 3.6.3 + TensorFlow 1.4.0 on Mac 10.13.1
Error:
/Users/sakigami/anaconda/bin/python /Users/sakigami/programmer/Python/tf_study/02_basic_models/random_forest.py
Extracting ../MNIST_data/train-images-idx3-ubyte.gz
Extracting ../MNIST_data/train-labels-idx1-ubyte.gz
Extracting ../MNIST_data/t10k-images-idx3-ubyte.gz
Extracting ../MNIST_data/t10k-labels-idx1-ubyte.gz
Traceback (most recent call last):
File "/Users/sakigami/programmer/Python/tf_study/02_basic_models/random_forest.py", line 36, in
correct_prediction = tf.equal(tf.argmax(infer_op, 1), tf.cast(Y, tf.string))
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py", line 316, in new_func
return func(*args, **kwargs)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/math_ops.py", line 205, in argmax
return gen_math_ops.arg_max(input, axis, name=name, output_type=output_type)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/gen_math_ops.py", line 441, in arg_max
name=name)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 513, in _apply_op_helper
raise err
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py", line 510, in _apply_op_helper
preferred_dtype=default_dtype)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 926, in internal_convert_to_tensor
ret = conversion_func(value, dtype=dtype, name=name, as_ref=as_ref)
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 970, in _autopacking_conversion_function
return _autopacking_helper(v, inferred_dtype, name or "packed")
File "/Users/sakigami/anaconda/lib/python3.6/site-packages/tensorflow/python/ops/array_ops.py", line 912, in _autopacking_helper
elem))
TypeError: Cannot convert a list containing a tensor of dtype <dtype: 'string'> to <dtype: 'float32'> (Tensor is: <tf.Tensor 'stack_2:0' shape=(?, 10) dtype=string>)
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: