Reputation: 37
train_label = tf.keras.backend.one_hot(train_label,3)
train_label = tf.one_hot(train_label,3)
give the following error in tensorflow 2.0.0
InternalError: Could not find valid device for node.
Node: {{node OneHot}}
Upvotes: 2
Views: 350
Reputation: 5097
train_label
should be a INT
type data. for example:
train_label = [1, 2 ,3]
train_label = tf.one_hot(train_label,3) // work
train_label = [1., 2., 3.]
train_label = tf.one_hot(train_label,3) // InternalError: Could not find valid device for node.
Upvotes: 3