我正在尝试在Tensorflow估计量上传递X和Y,但是
获取尺寸在features
和labels
上分别为TensorShape([Dimension(None), Dimension(65536)])
和TensorShape([Dimension(None)])
。
def model_fn(features, labels, mode):
#labels tensor is of None Dimension shape.
model = tf.estimator.Estimator(model_fn)
# Define the input function for training
input_fn = tf.estimator.inputs.numpy_input_fn(
x={'images': X_train}, y=np.ones(45,np.float),
batch_size=batch_size, num_epochs=20, shuffle=True)
# Train the Model
model.train(input_fn, steps=num_steps)
X_train
的维数为(45,65536)
,y很简单。
num_steps = 22
batch_size = 5