Tensorflow Estimator Train发送特征和标签为空

时间:2018-09-04 14:40:37

标签: python tensorflow tensorflow-estimator

我正在尝试在Tensorflow估计量上传递X和Y,但是

获取尺寸featureslabels上分别为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

0 个答案:

没有答案