簡體   English   中英

tensorflow 2.0.0 中 tf.one_hot 的等價物是什么

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

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM