-
-
Save melgor/41e7d9367410b71dfddc33db34cba85f to your computer and use it in GitHub Desktop.
Thank you for your tutorial!
However, after restoring cudnn_LSTM from checkpoint, I cant restore other variables from meta graph using something like this:
saver = tf.train.import_meta_graph("{}.meta".format(checkpoint))
saver.restore(sess, checkpoint)
That's to say, if I restore cudnn_LSTM in your way, then I cant restore other variables from meta graph.
And I need to get some variables like placeholder
, accuracy
for inference.
Can you tell me how to save and restore properly in this situation?
BTW, how can I restore cudnn variables to GPU directly? After googling a lot, I found that people just care about restoring cudnn variables to CPU, but I cant even restore it to GPU. Am I missing something? THANKS!
Hi, I'm running into troubles when restore into CudnnCompatibleLSTMCell from CudnnLSTM, I've run the code above on my machine, and it raised an error, so I'm wandering if I'm using the version that do not support this feature. Would you please provide your tensorflow version that can run the code above? I'm currently run on Tensorflow 1.5.
@SysuJayce I solved it, you should rebuild model and restore ckpt instead of using import_meta_graph
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)
restore_cudnn.ipynb
show how to save the model which use cudnn and then is restored usingCudnnCompatibleLSTMCell
(but not only GPU) cell.