Skip to content

Commit 70722b0

Browse files
committed
Add torch.unqueeze() in order to add 4th dimension at index 0
1 parent b818c85 commit 70722b0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

chapter2/Chapter 2.ipynb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@
286286
"\n",
287287
"img = Image.open(\"./val/fish/100_1422.JPG\") \n",
288288
"img = img_transforms(img).to(device)\n",
289+
"img = torch.unsqueeze(img, 0)\n",
289290
"\n",
290291
"simplenet.eval()\n",
291292
"prediction = F.softmax(simplenet(img), dim=1)\n",

0 commit comments

Comments
 (0)