From 4303d50b958b1e04b8c51045f0a7e30c7a00b6ad Mon Sep 17 00:00:00 2001 From: JEONGMYEONG CHOI <44393016+JeongMyeong@users.noreply.github.com> Date: Mon, 6 Jan 2020 14:48:37 +0900 Subject: [PATCH] =?UTF-8?q?Lab-11-5=EC=BD=94=EB=93=9C=EC=8B=A4=ED=96=89?= =?UTF-8?q?=EC=A4=91=20GPU=20=ED=99=98=EA=B2=BD=EC=97=90=EC=84=9C=20evalue?= =?UTF-8?q?ate=20=EC=8B=A4=ED=96=89=EA=B3=BC=EC=A0=95=EC=97=90=EC=84=9C=20?= =?UTF-8?q?=EB=B0=9C=EC=83=9D=ED=95=98=EB=8A=94=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RuntimeError: legacy constructor for device type: cpu was passed device type: cuda, but device type must be: cpu 발생하는 오류를 해결 --- lab-11_5_seq2seq.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lab-11_5_seq2seq.ipynb b/lab-11_5_seq2seq.ipynb index bd2b438..17c6238 100644 --- a/lab-11_5_seq2seq.ipynb +++ b/lab-11_5_seq2seq.ipynb @@ -253,7 +253,7 @@ " for ei in range(source_length):\n", " _, encoder_hidden = encoder(source_tensor[ei], encoder_hidden)\n", "\n", - " decoder_input = torch.Tensor([[SOS_token]], device=device).long()\n", + " decoder_input = torch.Tensor([[SOS_token]]).long().to(device)\n", " decoder_hidden = encoder_hidden\n", " decoded_words = []\n", "\n",