win10 CUDA 10.0 cudnn 7.4.1
E tensorflow/stream_executor/cuda/cuda_dnn.cc:319] Loaded runtime CuDNN library: 7.4.1 but source was compiled with: 7.6.0. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.
今天将原来在cpu上跑的程序移植到tensorflow-gpu 2.0的版本上跑,结果出现了如下错误:
Epoch 1/2
2020-10-29 10:36:22.735575: W tensorflow/core/grappler/optimizers/implementation_selector.cc:310] Skipping optimization due to error while loading function libraries: Invalid argument: Functions '__inference___backward_cudnn_lstm_with_fallback_2577_2759_specialized_for_StatefulPartitionedCall_at___inference_distributed_function_3542' and '__inference___backward_standard_lstm_2950_3435' both implement 'lstm_9415c58f-6404-4912-a877-c79616515424' but their signatures do not match.
2020-10-29 10:36:22.814593: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cublas64_100.dll
2020-10-29 10:36:23.099220: I tensorflow/stream_executor/platform/default/dso_loader.cc:44] Successfully opened dynamic library cudnn64_7.dll
1024/35254 [..............................] - ETA: 1:272020-10-29 10:36:24.145685: E tensorflow/stream_executor/cuda/cuda_dnn.cc:319] Loaded runtime CuDNN library: 7.4.1 but source was compiled with: 7.6.0. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.
2020-10-29 10:36:24.146821: W tensorflow/core/framework/op_kernel.cc:1622] OP_REQUIRES failed at cudnn_rnn_ops.cc:1491 : Unknown: Fail to find the dnn implementation.
2020-10-29 10:36:24.147015: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Unknown: Fail to find the dnn implementation.
[[{{node CudnnRNN}}]]
2020-10-29 10:36:24.147270: W tensorflow/core/common_runtime/base_collective_executor.cc:216] BaseCollectiveExecutor::StartAbort Unknown: {{function_node __forward_cudnn_lstm_with_fallback_2758_specialized_for_model_lstm_StatefulPartitionedCall_at___inference_distributed_function_3542}} {{function_node __forward_cudnn_lstm_with_fallback_2758_specialized_for_model_lstm_StatefulPartitionedCall_at___inference_distributed_function_3542}} Fail to find the dnn implementation.
[[{{node CudnnRNN}}]]
[[model/lstm/StatefulPartitionedCall]]
WARNING:tensorflow:Early stopping conditioned on metric `val_loss` which is not available. Available metrics are:
其中:
E tensorflow/stream_executor/cuda/cuda_dnn.cc:319] Loaded runtime CuDNN library: 7.4.1 but source was compiled with: 7.6.0. CuDNN library major and minor version needs to match or have higher minor version in case of CuDNN 7.0 or later version. If using a binary install, upgrade your CuDNN library. If building from sources, make sure the library loaded at runtime is compatible with the version specified during compile configuration.
查看报错的提示,最开始以为时cudnn版本不兼容,后来查资料发现有人和我遇到了基本相同的报错内容,参考:
[cudnn报错解决]Loaded runtime CuDNN library: 7.0.5 but source was compiled with: 7.2.1.
发现只要更改tensorflow-gpu的版本就可以了,于是将我的tensorflow-gpu 2.0
降为1.15
就可以了,而不用更改cudnn的版本。