【发布时间】:2021-01-11 22:01:19
【问题描述】:
我已经使用 GPU 在 tensorflow 中使用 CUDNNLSTM 训练了一个模型。当我尝试在 cpu 中使用模型进行推理时,出现此错误:
Invalid argument: No OpKernel was registered to support Op 'CudnnRNN' with these attrs. Registered devices: [CPU], Registered kernels:
<no registered kernels>
[[Node: cudnn_lstm/CudnnRNN = CudnnRNN[T=DT_FLOAT, direction="bidirectional", dropout=0, input_mode="linear_input", is_training=false, rnn_mode="lstm", seed=87654321, seed2=4567](Reshape_1, cudnn_lstm/zeros, cudnn_lstm/zeros_1, cudnn_lstm/opaque_kernel/read)]]
那么,我们如何在 cpu 中使用这个模型呢?
【问题讨论】:
-
看来您需要在 GPU 上运行 CUDNN。请参阅stackoverflow.com/questions/48086014/… 可能您可以只保存训练模型中的权重,然后将其读入?
标签: python tensorflow