Skip to content

Instantly share code, notes, and snippets.

@melgor
Last active June 25, 2021 04:32
Show Gist options
  • Save melgor/41e7d9367410b71dfddc33db34cba85f to your computer and use it in GitHub Desktop.
Save melgor/41e7d9367410b71dfddc33db34cba85f to your computer and use it in GitHub Desktop.
How to restore CUDNNLSTM of TensorFlow at CPU device? So that it could be used in GPU, CPU or Mobile
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Copy link

ghost commented Jun 25, 2021

for anyone who had the same issue I did, remember to set time_major=True in stack_bidirectional_dynamic_rnn().

The CudnnLSTM() function is time major, as opposed to batch major. So remember to transpose your inputs and outputs (swap dimensions 0 and 1)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment