I am trying to fit a model with string labels in form ["aa", "aa", "bb", "bb", "bb", "cc"]
and wanted to use tf.one_hot(labels, depth=3)
to get the one hot vectors but I get the error:
NotFoundError: Could not find valid device for node.
Node:{{node OneHot}}
All kernels registered for op OneHot :
device='XLA_GPU'; TI in [DT_INT32, DT_UINT8, DT_INT64]; T in [DT_FLOAT, DT_DOUBLE, DT_INT32, DT_UINT8, DT_INT16, ..., DT_UINT16, DT_COMPLEX128, DT_HALF, DT_UINT32, DT_UINT64]
device='XLA_CPU'; TI in [DT_INT32, DT_UINT8, DT_INT64]; T in [DT_FLOAT, DT_DOUBLE, DT_INT32, DT_UINT8, DT_INT16, ..., DT_UINT16, DT_COMPLEX128, DT_HALF, DT_UINT32, DT_UINT64]
my questions:
1- is it even possible to transform these kind of label to one hot directly with tensorflow 2
or should the input be INT
?
2- if yes what could cause this problem
3-is it possible to fit a model directly with string labels?
extra information:
I am using a cluster to train and using GPU
and defined my device using os.environ["CUDA_VISIBLE_DEVICES"]="2"
based on this
I will post more of my code if it's necessary.