From 072bf760030b11f36e3bedaa4b88729a75d0aa6e Mon Sep 17 00:00:00 2001 From: ByeongKeon Kin Date: Sun, 6 Jan 2019 14:37:43 +0900 Subject: [PATCH] Trasfering current_seq to CPU from GPU We should transfer current_seq to CPU from GPU, to prevent error. --- project-tv-script-generation/dlnd_tv_script_generation.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project-tv-script-generation/dlnd_tv_script_generation.ipynb b/project-tv-script-generation/dlnd_tv_script_generation.ipynb index 5820563534..991de29688 100644 --- a/project-tv-script-generation/dlnd_tv_script_generation.ipynb +++ b/project-tv-script-generation/dlnd_tv_script_generation.ipynb @@ -786,6 +786,8 @@ " word = int_to_vocab[word_i]\n", " predicted.append(word) \n", " \n", + " if(train_on_gpu):\n", + " current_seq = current_seq.cpu() # move to cpu\n", " # the generated word becomes the next \"current sequence\" and the cycle can continue\n", " current_seq = np.roll(current_seq, -1, 1)\n", " current_seq[-1][-1] = word_i\n",