I'm trying to create a packet classifier using packet flows in Tensorflow 2.4.0. When training my model using tf.estimator, I get the error:
ValueError: column_name: avg_piat input_tensor dtype must be string or integer. dtype: <dtype: 'float32'>.
Here is a portion of the data set which contains avg_piat:
I've tried doing everything from similar questions but nothing seems to be working. I'm thinking it might be from how I create my feature columns but I'm not sure. Here are how I create my feature columns. Thanks in advance.
min_piat = tf.feature_column.categorical_column_with_hash_bucket("min_piat",hash_bucket_size=1000)
max_piat = tf.feature_column.categorical_column_with_hash_bucket("max_piat",hash_bucket_size=1000)
avg_piat = tf.feature_column.categorical_column_with_hash_bucket("avg_piat",hash_bucket_size=1000)
## Edit ##
I solved the issue. When I defined a feature column for avg_piat I changed it from a hash bucket to a numerical column:
avg_piat = tf.feature_column.numeric_column("avg_piat")
question from:
https://stackoverflow.com/questions/65903192/valueerror-column-name-input-tensor-dtype-must-be-string-or-integer-dtype-d 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…