[英]Error: No OpKernel was registered to support Op 'DepthToSpace' used by node DepthToSpace
I am trying to train a TensorFlow model.我正在尝试训练 TensorFlow model。 I get the following error:
我收到以下错误:
Initializing models: 0%| | 0/5 [00:00<?, ?it/s]
Error: No OpKernel was registered to support Op 'DepthToSpace' used by node DepthToSpace
with these attrs: [data_format="NCHW", block_size=2, T=DT_FLOAT]
Registered devices: [CPU]
Registered kernels:
device='GPU'; T in [DT_QINT8]
device='GPU'; T in [DT_HALF]
device='GPU'; T in [DT_FLOAT]
device='CPU'; T in [DT_VARIANT]; data_format in ["NHWC"]
device='CPU'; T in [DT_RESOURCE]; data_format in ["NHWC"]
device='CPU'; T in [DT_STRING]; data_format in ["NHWC"]
device='CPU'; T in [DT_BOOL]; data_format in ["NHWC"]
device='CPU'; T in [DT_COMPLEX128]; data_format in ["NHWC"]
device='CPU'; T in [DT_COMPLEX64]; data_format in ["NHWC"]
device='CPU'; T in [DT_DOUBLE]; data_format in ["NHWC"]
device='CPU'; T in [DT_FLOAT]; data_format in ["NHWC"]
device='CPU'; T in [DT_BFLOAT16]; data_format in ["NHWC"]
device='CPU'; T in [DT_HALF]; data_format in ["NHWC"]
device='CPU'; T in [DT_INT32]; data_format in ["NHWC"]
device='CPU'; T in [DT_INT8]; data_format in ["NHWC"]
device='CPU'; T in [DT_UINT8]; data_format in ["NHWC"]
device='CPU'; T in [DT_INT16]; data_format in ["NHWC"]
device='CPU'; T in [DT_UINT16]; data_format in ["NHWC"]
device='CPU'; T in [DT_UINT32]; data_format in ["NHWC"]
device='CPU'; T in [DT_INT64]; data_format in ["NHWC"]
device='CPU'; T in [DT_UINT64]; data_format in ["NHWC"] [[DepthToSpace]]
OS: Ubuntu 20.04, Python version: Python 3.8.5, Tensorflow version: 2.4.0, Graphics card: GeForce RTX 3090, NVIDIA driver: 460.67, CUDA version: 11.2 OS: Ubuntu 20.04, Python version: Python 3.8.5, Tensorflow version: 2.4.0, Graphics card: GeForce RTX 3090, NVIDIA driver: 460.67, CUDA version: 11.2
How do I fix it?我如何解决它?
It is an issue related to TensorFlow GPU and CUDA.这是与 TensorFlow GPU 和 CUDA 相关的问题。 Just change TensorFlow version with Python version as following:
只需将 TensorFlow 版本更改为 Python 版本如下:
TensorFlow GPU version: 2.4.1
Python version: 3.6.9
To test CUDA support for TensorFlow, just run following command:要测试 CUDA 对 TensorFlow 的支持,只需运行以下命令:
import tensorflow as tf
tf.test.is_built_with_cuda()
It should return True它应该返回True
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.