How do I load categorical data from a numpy array into an Indicator or Embedding column?
How do I load categorical data from a numpy array into an Indicator or Embedding column? Using Tensorflow 1.8.0, we are running into an issue whenever we attempt to build a categorical column. Here is a full example demonstrating the problem. It runs as-is (using only numeric columns). Uncommenting the indicator column definition and data generates a stack trace ending in tensorflow.python.framework.errors_impl.InternalError: Unable to get element as bytes. tensorflow.python.framework.errors_impl.InternalError: Unable to get element as bytes. import tensorflow as tf import numpy as np def feature_numeric(key): return tf.feature_column.numeric_column(key=key, default_value=0) def feature_indicator(key, vocabulary): return tf.feature_column.indicator_column( tf.feature_column.categorical_column_with_vocabulary_list( key=key, vocabulary_list=vocabulary )) labels = ['Label1','Label2','Label3'] model = tf.estimator.DNNClassifier( feature_columns=[ ...