Tensorflow错误InvalidArgumentError see above for traceback): No OpKernel was registered to support Op

调用tensorflow-gpu运行错误

错误信息如下:

2023-06-21 15:36:14.007389: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2023-06-21 15:36:14.012266: E tensorflow/stream_executor/cuda/cuda_driver.cc:300] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected
2023-06-21 15:36:14.012286: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:163] retrieving CUDA diagnostic information for host: fbfef9203a7c
2023-06-21 15:36:14.012289: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:170] hostname: fbfef9203a7c
2023-06-21 15:36:14.012309: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:194] libcuda reported version is: 525.116.4
2023-06-21 15:36:14.012318: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:198] kernel reported version is: 525.116.4
2023-06-21 15:36:14.012320: I tensorflow/stream_executor/cuda/cuda_diagnostics.cc:305] kernel version seems to match DSO: 525.116.4

InvalidArgumentError (see above for traceback): No OpKernel was registered to support Op 'FusedConvRandomK' with these attrs.  Registered devices: [CPU,XLA_CPU,XLA_GPU], Registered kernels:
  device='GPU'

首先检查tf中显卡是否可用

import tensorflow as tf
print('GPU',tf.test.is_gpu_available())

正常的话会打印相关信息

其次 检查代码中的显卡编号 是否正确 默认一张显卡编号 应该是0!!!!

os.environ['CUDA_VISIBLE_DEVICES'] = str(0)

类似的代码!是否与实际相符!

猜你喜欢

转载自blog.csdn.net/li4692625/article/details/131335528
今日推荐