Skip to content

Commit 0aff9b8

Browse files
committed
Fix annoying download deprecation warning
1 parent 7be4223 commit 0aff9b8

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
77
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
88
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
99
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
10+
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
1011

1112
[compat]
1213
CUDA = "4, 5"

test/model_tests.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using Metalhead, Images, TestImages
33
using Flux: gradient, gpu
44
using CUDA: CUDA, has_cuda
5+
using Downloads
56

67
export PRETRAINED_MODELS,
78
TEST_FAST,
@@ -72,7 +73,9 @@ const TEST_X = let img_array = convert(Array{Float32}, channelview(TEST_IMG))
7273
end
7374

7475
# ImageNet labels
75-
const TEST_LBLS = readlines(download("https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt"))
76+
const TEST_LBLS = readlines(Downloads.download(
77+
"https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt"
78+
))
7679

7780
function acctest(model)
7881
ypred = gpu(model)(TEST_X) |> collect |> vec

0 commit comments

Comments
 (0)