小编hux*_*ux0的帖子

Tensorflow One Hot Encoding - 找不到节点的有效设备

在我的功能工程期间,发生了以下错误。我的功能列表有 21 个子列表,每个 8537 个值是 0 或 1。当尝试通过 tensorflow 运行 One Hot Encoding 时,它显示错误Could not find valid device for node 有没有人有快速修复错误的方法?

for feature in featurelist[1:]:
    df = tensorflow.convert_to_tensor(feature, dtype=tensorflow.float32)
    print(df)
    df_enc = tensorflow.one_hot(df, 2, on_value=None, off_value=None, axis=None, dtype=None, name=None)
    print(df_enc)
Run Code Online (Sandbox Code Playgroud)
2020-05-29 15:08:41.969878: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x7fdefbc23d50 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2020-05-29 15:08:41.969919: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
tf.Tensor([0. 0. 0. ... 0. 0. 0.], shape=(8537,), …
Run Code Online (Sandbox Code Playgroud)

python keras tensorflow one-hot-encoding feature-engineering

3
推荐指数
1
解决办法
934
查看次数