Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encounter a problem #318

Open
zc317414 opened this issue Oct 19, 2022 · 2 comments
Open

encounter a problem #318

zc317414 opened this issue Oct 19, 2022 · 2 comments

Comments

@zc317414
Copy link

InvalidArgumentError: Graph execution error:

2 root error(s) found.
(0) INVALID_ARGUMENT: 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:

 [[CudnnRNN]]
 [[model/bidirectional/forward_lstm_3/PartitionedCall]]
 [[binary_crossentropy/logistic_loss/_12]]

(1) INVALID_ARGUMENT: 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:

 [[CudnnRNN]]
 [[model/bidirectional/forward_lstm_3/PartitionedCall]]

0 successful operations.
0 derived errors ignored. [Op:__inference_train_function_53639]

@zc317414
Copy link
Author

import numpy as np
from tensorflow import keras
from tensorflow.keras import layers
max_features = 20000 # Only consider the top 20k words
maxlen = 200 # Only consider the first 200 words of each movie review

Input for variable-length sequences of integers

inputs = keras.Input(shape=(None,), dtype="int32")

Embed each integer in a 128-dimensional vector

x = layers.Embedding(max_features, 128)(inputs)

Add 2 bidirectional LSTMs

x = layers.Bidirectional(layers.LSTM(64, return_sequences=True))(x)
x = layers.Bidirectional(layers.LSTM(64))(x)

Add a classifier

outputs = layers.Dense(1, activation="sigmoid")(x)
model = keras.Model(inputs, outputs)

(x_train, y_train), (x_val, y_val) = keras.datasets.imdb.load_data(
num_words=max_features
)
print(len(x_train), "Training sequences")
print(len(x_val), "Validation sequences")
x_train = keras.preprocessing.sequence.pad_sequences(x_train, maxlen=maxlen)
x_val = keras.preprocessing.sequence.pad_sequences(x_val, maxlen=maxlen)

model.compile("adam", "binary_crossentropy", metrics=["accuracy"])
model.fit(x_train, y_train, batch_size=32, epochs=2, validation_data=(x_val, y_val))

@PatriceVignola
Copy link
Contributor

Hi @zc317414 ,

This is similar to this issue. We're currently working on it and will update this issue once we have more updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants