I am trying to predict a future mean temperature using Tensorflows linear classifier estimator. The target feature is of float64 type and the other features that are being used to predict the mean temperature are also float64.
Below is the method I am using to convert the features into tf numerical columns.
for feature_name in NUMERIC_COLUMNS:
feature_columns.append(tf.feature_column.numeric_column(
feature_name, dtype=tf.float64))
I create the linear estimator as shown
feature_columns=feature_columns, n_classes=4)
When it comes to training the model I get the following error.
WARNING:tensorflow:Layer linear/linear_model is casting an input tensor from
dtype float64 to the layer's dtype of float32,
which is new behavior in TensorFlow 2. The layer has dtype float32
because it's dtype defaults to floatx.
Exception has occurred: ValueError
Labels dtype should be integer. Instead got <dtype: 'float64'>.
I am struggling to understand why this would be considering I explicitly stated I wanted all the features to be of type float64.