Tensorflow - Op Type not registered 'CudnnRNN'

风流意气都作罢 提交于 2019-12-11 09:51:51

问题


I am new to tensorflow and trying to set it up.

When I try to train a model using CuDNNGRU it seems to load correctly and then gives an error :

tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered 'CudnnRNN'

I do see a Cudnn_rnn directory in tensorflow/contrib for what that is worth.

I have python 3.6 and VS2013.

I have tried the following, but still getting an error:

  • Both Cuda 8/9
  • uninstalling/reinstalling tensorflow/Theano/Keras/TensorFlow

Honestly the setup seems so convoluted and touchy, I may have screwed something up.

Am I missing a to-do? Some way to manually fix? Thanks!

Sample code I am trying to replicate:

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)

回答1:


I fixed this by doing :

pip install tensorflow --ignore-installed --upgrade

and then

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



来源:https://stackoverflow.com/questions/48493294/tensorflow-op-type-not-registered-cudnnrnn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!