I am new to Tensorflow and trying to run a neural network on .csv file with 60 columns. However some of them contain string fields. I tried to run the program I got could not convert string to float: This is the code.
# Load datasets.
training_set = tf.contrib.learn.datasets.base.load_csv_without_header(
filename=TRAINING,
target_dtype=np.int,
features_dtype=np.float32)
test_set = tf.contrib.learn.datasets.base.load_csv_without_header(
filename=TEST,
target_dtype=np.int,
features_dtype=np.float32)
# Specify that all features have real-value data
feature_columns = [tf.feature_column.numeric_column("x", shape=[59])]
classifier = tf.estimator.DNNClassifier(feature_columns=feature_columns,
hidden_units=[59],
n_classes=2)
Now I read that target_dtype and features_dtype take on numpy types. I searched here https://docs.scipy.org/doc/numpy/user/basics.types.html and looks like they don't have a string fields. What is the best way to achieve this?