Hello everyone, I hope you all doing great
I’m using tensorflow-cpu 2.10 with tf-directml-plugin, and I keep getting this error
InvalidArgumentError: Graph execution error: No OpKernel was registered to support Op ‘CudnnRNN’ used by {{node CudnnRNN}} with these attrs: [seed=0, dropout=0, T=DT_FLOAT, input_mode=“linear_input”, direction=“unidirectional”, rnn_mode=“lstm”, seed2=0, is_training=true] Registered devices: [CPU, GPU] Registered kernels:
My specs:
Windows 11
RTX 4080
Here is my code:
# Set the maximum vocabulary size
vocab_size = 10000
# Convert the training text to sequences
train_sequences = tokenizer.texts_to_sequences(train_texts)
# Pad the sequences to have the same length
max_sequence_length = max(len(seq) for seq in train_sequences)
train_data = pad_sequences(train_sequences, maxlen=max_sequence_length)
# Create the main model
main_model = Sequential()
# Add the layers to the main model
main_model.add(Embedding(input_dim=vocab_size, output_dim=100, input_length=max_sequence_length))
main_model.add(Bidirectional(LSTM(64, return_sequences=True)))
# Create the Attention layer
attention = Attention()
# Apply the Attention layer to the main model's output
attention_output = attention([main_model.layers[-1].output, main_model.layers[-1].output])
# Create the new model that takes the Attention layer output as input
output = Dense(1, activation='sigmoid')(attention_output)
model = Model(inputs=main_model.input, outputs=output)
# Compile the model
model.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy'])
# Reshape the predicted labels
train_labels = np.expand_dims(train_labels, axis=-1)
# Train the Bi-LSTM classifier on the whole training dataset
model.fit(train_data, train_labels, epochs=1, batch_size=32, verbose=1)