问题
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