[英]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.