[英]what is the equivalence of tf.one_hot in tensorflow 2.0.0
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}}
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.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.