Skip to content

Commit 65d2333

Browse files
committed
tring manual download
1 parent 67b2cf6 commit 65d2333

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

published-202204-gimenez-lynx.qmd

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1120,12 +1120,16 @@ dls <- ImageDataLoaders_from_folder(
11201120

11211121
Then we get the model architecture. For the sake of illustration, we use a resnet18 here, but we used a resnet50 to get the full results presented in the main text.
11221122

1123-
<!-- ```{python, echo=FALSE}
1124-
## Fix ssl download error
1125-
import ssl
1126-
ssl._create_default_https_context = ssl._create_unverified_context
1127-
``` -->
1128-
1123+
```{bash, echo=FALSE}
1124+
FILE=~/.cache/torch/hub/checkpoints/resnet18-f37072fd.pth
1125+
if test -f "$FILE"; then
1126+
echo "$FILE exists."
1127+
else
1128+
mkdir -p ~/.cache/torch/hub/checkpoints/resnet18-f37072fd.pth
1129+
wget -c https://download.pytorch.org/models/resnet18-f37072fd.pth
1130+
mv resnet18-f37072fd.pth ~/.cache/torch/hub/checkpoints/
1131+
fi
1132+
```
11291133

11301134
```{r echo = TRUE}
11311135
learn <- cnn_learner(dls = dls,

0 commit comments

Comments
 (0)