From 0cfc21d1bb8d02db22563f8ab3c77281c7f153ec Mon Sep 17 00:00:00 2001 From: inoue0426 Date: Mon, 8 Jul 2024 11:17:28 -0400 Subject: [PATCH] update add device setting --- Tutorial.ipynb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Tutorial.ipynb b/Tutorial.ipynb index e9bb5dd..db99820 100644 --- a/Tutorial.ipynb +++ b/Tutorial.ipynb @@ -780,7 +780,7 @@ "source": [ "tmp = !ls | grep pt\n", "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n", - "model = torch.load(tmp[0])" + "model = torch.load(tmp[0], map_location=device)" ] }, { @@ -902,9 +902,9 @@ ], "metadata": { "kernelspec": { - "display_name": "py39", + "display_name": "torch", "language": "python", - "name": "py39" + "name": "torch" }, "language_info": { "codemirror_mode": { @@ -916,7 +916,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.17" + "version": "3.11.9" } }, "nbformat": 4,