Tensorflow - Op Type 未注册 'CudnnRNN'



我是Tensorflow的新手,并试图设置它。

当我尝试使用 CuDNNGRU 训练模型时,它似乎加载正确,然后给出错误:

tensorflow.python.framework.errors_impl。未找到错误:操作类型不是 注册"CudnnRNN">

我确实在tensorflow/contrib中看到了一个Cudnn_rnn目录,这是值得的。

我有python 3.6和VS2013。

我已经尝试了以下方法,但仍然收到错误:

  • 两个库达 8/9
  • 卸载/重新安装 tensorflow/Theano/Keras/TensorFlow

老实说,设置似乎如此复杂和敏感,我可能搞砸了一些东西。

我错过了待办事项吗? 某种手动修复的方法?谢谢!

我正在尝试复制的示例代码:

def get_model(embedding, sequence_length, dropout_rate, recurrent, dense_size):
input_layer = Input(shape=(sequence_length,))
embedding_layer = Embedding(embedding.shape[0], embedding.shape[1],
                            weights=[embedding], trainable=False)(input_layer)
x = Bidirectional(CuDNNGRU(recurrent, return_sequences=True))(embedding_layer)
x = Dropout(dropout_rate)(x)
x = Bidirectional(CuDNNGRU(recurrent, return_sequences=False))(x)
x = Dense(dense_size, activation="relu")(x)

我通过以下方式解决了这个问题:

pip install tensorflow --ignore-install --upgrade

然后

from tensorflow.python.client import device_lib print(device_lib.list_local_devices(((

最新更新