train_label = tf.keras.backend.one_hot(train_label,3)
train_label = tf.one_hot(train_label,3)
在tensorflow 2.0.0中给出以下错误
InternalError: Could not find valid device for node.
节点:{{node OneHot}}
答案 0 :(得分:0)
train_label
应该是INT
类型的数据。例如:
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.