From 7951c262fd7853216a60229ed45c5ec17a7ec1bf Mon Sep 17 00:00:00 2001 From: Arun S V Date: Sat, 25 Mar 2023 15:47:29 +0530 Subject: [PATCH 1/3] make sure model on traget device In section 6.2 while defining train_step and test_step functions move also the model to target device. --- 03_pytorch_computer_vision.ipynb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/03_pytorch_computer_vision.ipynb b/03_pytorch_computer_vision.ipynb index ff4bc7a..18892aa 100644 --- a/03_pytorch_computer_vision.ipynb +++ b/03_pytorch_computer_vision.ipynb @@ -1497,6 +1497,7 @@ " accuracy_fn,\n", " device: torch.device = device):\n", " train_loss, train_acc = 0, 0\n", + " model.to(device)\n", " for batch, (X, y) in enumerate(data_loader):\n", " # Send data to GPU\n", " X, y = X.to(device), y.to(device)\n", @@ -1530,6 +1531,7 @@ " accuracy_fn,\n", " device: torch.device = device):\n", " test_loss, test_acc = 0, 0\n", + " model.to(device)\n", " model.eval() # put model in eval mode\n", " # Turn on inference context manager\n", " with torch.inference_mode(): \n", From 534725852026e82dc078051630502580f17b4fb0 Mon Sep 17 00:00:00 2001 From: Agamdeep Singh <67156641+jnash10@users.noreply.github.com> Date: Tue, 4 Apr 2023 11:18:44 +0530 Subject: [PATCH 2/3] Typo correction: 'ot' --> 'to' --- 00_pytorch_fundamentals.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/00_pytorch_fundamentals.ipynb b/00_pytorch_fundamentals.ipynb index 77ea89f..d9e60e7 100644 --- a/00_pytorch_fundamentals.ipynb +++ b/00_pytorch_fundamentals.ipynb @@ -3261,7 +3261,7 @@ "| ----- | ----- | ----- | ----- | ----- |\n", "| Google Colab | Easy | Free to use, almost zero setup required, can share work with others as easy as a link | Doesn't save your data outputs, limited compute, subject to timeouts | [Follow the Google Colab Guide](https://colab.research.google.com/notebooks/gpu.ipynb) |\n", "| Use your own | Medium | Run everything locally on your own machine | GPUs aren't free, require upfront cost | Follow the [PyTorch installation guidelines](https://pytorch.org/get-started/locally/) |\n", - "| Cloud computing (AWS, GCP, Azure) | Medium-Hard | Small upfront cost, access to almost infinite compute | Can get expensive if running continually, takes some time ot setup right | Follow the [PyTorch installation guidelines](https://pytorch.org/get-started/cloud-partners/) |\n", + "| Cloud computing (AWS, GCP, Azure) | Medium-Hard | Small upfront cost, access to almost infinite compute | Can get expensive if running continually, takes some time to setup right | Follow the [PyTorch installation guidelines](https://pytorch.org/get-started/cloud-partners/) |\n", "\n", "There are more options for using GPUs but the above three will suffice for now.\n", "\n", From d504674731540e982cbb8a60bc64eac424d343ab Mon Sep 17 00:00:00 2001 From: Agamdeep Singh <67156641+jnash10@users.noreply.github.com> Date: Tue, 4 Apr 2023 15:56:26 +0530 Subject: [PATCH 3/3] Corrected : Mismatch in learning rate in description and code A learning rate = 0.01 was used in the code but it's written a learning rate = 0.1 worked well so we'll use it again. --- 01_pytorch_workflow.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/01_pytorch_workflow.ipynb b/01_pytorch_workflow.ipynb index de346d0..8e08672 100644 --- a/01_pytorch_workflow.ipynb +++ b/01_pytorch_workflow.ipynb @@ -1922,7 +1922,7 @@ "\n", "We'll have to pass the new model's parameters (`model.parameters()`) to the optimizer for it to adjust them during training. \n", "\n", - "The learning rate of `0.1` worked well before too so let's use that again.\n", + "The learning rate of `0.01` worked well before too so let's use that again.\n", "\n", "\n" ]