Tensorflow 误InvalidArgumentError トレースバックについては上記を参照してください): OpKernel が 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