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)

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值