我正尝试如下使用Tensorflow中的canned RNN Estimator:
import tensorflow as tf
sequence_feature_colums = [tf.contrib.feature_column.sequence_numeric_column("test")]
estimator = tf.contrib.estimator.RNNEstimator(
head=tf.contrib.estimator.regression_head(),
sequence_feature_columns=sequence_feature_colums)
def input_fn_train():
dataset = tf.data.Dataset.from_tensor_slices(({"test": [0]}, [0]))
dataset = dataset.batch(1)
return dataset
estimator.train(input_fn=input_fn_train, steps=1)
但是我收到错误TypeError: Input must be a SparseTensor.
这对我来说就像是个错误,或者我使用错了吗?
tensorflow==1.14.0
编辑:我创建了一个问题-https://github.com/tensorflow/tensorflow/issues/30456