简体   繁体   中英

Eager Execution: Could not find valid device for node. {{node Conv2D}}

I'm trying to build a image classifier in Tensorflow under the eager-execution mode. I am receiving the following error.

InternalError: Could not find valid device for node.
Node: {{node Conv2D}} = Conv2D[T=DT_UINT8, data_format="NHWC", 
dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 2, 2, 1], 
use_cudnn_on_gpu=true](dummy_input, dummy_input)
All kernels registered for op Conv2D :
device='XLA_CPU'; T in [DT_FLOAT, DT_DOUBLE, DT_HALF]
device='XLA_GPU'; T in [DT_FLOAT, DT_DOUBLE, DT_BFLOAT16, 
DT_HALF]
device='GPU'; T in [DT_DOUBLE]
device='GPU'; T in [DT_FLOAT]
device='GPU'; T in [DT_HALF]
device='CPU'; T in [DT_DOUBLE]
device='CPU'; T in [DT_FLOAT]
device='CPU'; T in [DT_HALF]
device='XLA_CPU_JIT'; T in [DT_FLOAT, DT_DOUBLE, DT_HALF]
device='XLA_GPU_JIT'; T in [DT_FLOAT, DT_DOUBLE, DT_BFLOAT16, 
DT_HALF]
[Op:Conv2D]

Any ideas why?

The error is because you are trying to load an int32 tensor to the conv2d block. You will have to check the supported input tensor types before passing a tensor to a particular tensorflow function.

For instance if you checkout the tensorflow source code over here tf.nn.conv2d for conv2d, the supported input types are half , bfloat16 , float32 , float64 .

This is also indicated in your error after the statement - "All kernels registered for op Conv2D"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM