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

Fixed UnknownError exception by changing how GRU is implemented in the model #542

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TassaraR
Copy link

@TassaraR TassaraR commented Sep 3, 2022

This changes refer to the sequential recommendations example notebook.

Original published code threw the following exception while trying to train the model (in Google Collab)

query_model = tf.keras.Sequential([
    tf.keras.layers.StringLookup(
      vocabulary=unique_movie_ids, mask_token=None),
    tf.keras.layers.Embedding(len(unique_movie_ids) + 1, embedding_dimension), 
    tf.keras.layers.GRU(embedding_dimension)
])
model.fit(cached_train, epochs=3)
Epoch 1/3
---------------------------------------------------------------------------
UnknownError                              Traceback (most recent call last)
[<ipython-input-87-5f54841df216>](https://localhost:8080/#) in <module>
----> 1 model.fit(cached_train, epochs=3)

1 frames
[/usr/local/lib/python3.7/dist-packages/tensorflow/python/eager/execute.py](https://localhost:8080/#) in quick_execute(op_name, num_outputs, inputs, attrs, ctx, name)
     53     ctx.ensure_initialized()
     54     tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
---> 55                                         inputs, attrs, num_outputs)
     56   except core._NotOkStatusException as e:
     57     if name is not None:

UnknownError: Graph execution error:

Fail to find the dnn implementation.
	 [[{{node CudnnRNN}}]]
	 [[sequential_18/gru_8/PartitionedCall]] [Op:__inference_train_function_26280]

Changing

tf.keras.layers.GRU(embedding_dimension)

to

tf.keras.layers.RNN(tf.keras.layers.GRUCell(embedding_dimension))

Fixed this issue and allowed the model to be trained normally

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

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

Successfully merging this pull request may close these issues.

1 participant