I'm new to Keras and Tensorflow. Yesterday, I came across an error which is the following:
TypeError: '<' not supported between instances of 'str' and 'float'
The block of code that gave this error is:
for name, inpt in inputs.items():
if inpt.dtype == tf.string:
lookup = layers.StringLookup(vocabulary=np.unique(train[name]))
Here, inputs is a dictionary which contains Tensors of each column of the train dataset. All have the dtype of either float32 or string.
In the above code, I'm trying to fetch only the string dtypes but it's giving me the error that cannot compare str & float which has made me confused as the code should fetch only the string dtypes features.
Where am I doing wrong? Can you tell me?