Skip to content

Commit

Permalink
Fix annoying download deprecation warning
Browse files Browse the repository at this point in the history
  • Loading branch information
theabhirath committed Dec 26, 2023
1 parent 7be4223 commit 0aff9b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
TestImages = "5e47fb64-e119-507b-a336-dd2b206d9990"
TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
cuDNN = "02a925ec-e4fe-4b08-9a7e-0d78e3d38ccd"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"

[compat]
CUDA = "4, 5"
Expand Down
5 changes: 4 additions & 1 deletion test/model_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Metalhead, Images, TestImages
using Flux: gradient, gpu
using CUDA: CUDA, has_cuda
using Downloads

export PRETRAINED_MODELS,
TEST_FAST,
Expand Down Expand Up @@ -72,7 +73,9 @@ const TEST_X = let img_array = convert(Array{Float32}, channelview(TEST_IMG))
end

# ImageNet labels
const TEST_LBLS = readlines(download("https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt"))
const TEST_LBLS = readlines(Downloads.download(
"https://raw.githubusercontent.com/pytorch/hub/master/imagenet_classes.txt"
))

function acctest(model)
ypred = gpu(model)(TEST_X) |> collect |> vec
Expand Down

0 comments on commit 0aff9b8

Please sign in to comment.