Skip to content

Commit 072bf76

Browse files
committed
Trasfering current_seq to CPU from GPU
We should transfer current_seq to CPU from GPU, to prevent error.
1 parent d3f2732 commit 072bf76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

project-tv-script-generation/dlnd_tv_script_generation.ipynb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,8 @@
786786
" word = int_to_vocab[word_i]\n",
787787
" predicted.append(word) \n",
788788
" \n",
789+
" if(train_on_gpu):\n",
790+
" current_seq = current_seq.cpu() # move to cpu\n",
789791
" # the generated word becomes the next \"current sequence\" and the cycle can continue\n",
790792
" current_seq = np.roll(current_seq, -1, 1)\n",
791793
" current_seq[-1][-1] = word_i\n",

0 commit comments

Comments
 (0)