recommenders
recommenders copied to clipboard
Fixed UnknownError exception by changing how GRU is implemented in the model
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
Check out this pull request on ![]()
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB