FluxML / Metalhead.jl

Computer vision models for Flux
https://fluxml.ai/Metalhead.jl
Other
328 stars 65 forks source link

Readme example fails #46

Closed hros closed 4 years ago

hros commented 5 years ago

Trying to execute the example in the readme.md file: image But when running the classify command, I get the following error:

ERROR: MethodError: no method matching maxpool(::Array{Float32,4}, ::Tuple{Int64,Int64})

I am running Julia version 1.1.1 on Ubuntu 16.04

ekinimo commented 5 years ago

i have the same problem with the exact same setup, Here are the test results for Metalhead

(v1.1) pkg> test Metalhead Testing Metalhead Status /tmp/tmpTgwaAI/Manifest.toml [621f4979] AbstractFFTs v0.4.1 [1520ce14] AbstractTrees v0.2.1 [79e6a3ab] Adapt v0.4.2 [13072b0f] AxisAlgorithms v1.0.0 [39de3d68] AxisArrays v0.3.0 [fbb218c0] BSON v0.2.3 [9e28174c] BinDeps v0.8.10 [b99e7846] BinaryProvider v0.5.4 [00ebfdb7] CSTParser v0.6.0 [aafaddc9] CatIndices v0.2.0 [944b1d66] CodecZlib v0.5.2 [3da002f7] ColorTypes v0.8.0 [c3611d14] ColorVectorSpace v0.6.2 [5ae59095] Colors v0.9.5 [bbf7d656] CommonSubexpressions v0.2.0 [34da2185] Compat v2.1.0 [ed09eef8] ComputationalResources v0.3.0 [8f4d0f93] Conda v1.3.0 [150eb455] CoordinateTransformations v0.5.0 [a8cc5b0e] Crayons v4.0.0 [dc8bdbbb] CustomUnitRanges v0.2.0 [864edb3b] DataStructures v0.15.0 [163ba53b] DiffResults v0.0.4 [b552c78f] DiffRules v0.0.10 [b4f34e82] Distances v0.8.0 [4f61f5a4] FFTViews v0.2.0 [7a1cc6ca] FFTW v0.2.4 [5789e2e9] FileIO v1.0.7 [53c48c17] FixedPointNumbers v0.5.3 [587475ba] Flux v0.8.3 [f6369f11] ForwardDiff v0.10.3 [a2bd30eb] Graphics v0.4.0 [bbac6d45] IdentityRanges v0.3.0 [2803e5a7] ImageAxes v0.6.0 [a09fc81d] ImageCore v0.7.4 [51556ac3] ImageDistances v0.1.1 [6a3955dd] ImageFiltering v0.5.4 [bc367c6b] ImageMetadata v0.7.1 [787d08f9] ImageMorphology v0.1.1 [4e3cecfd] ImageShow v0.2.0 [02fcd773] ImageTransformations v0.8.0 [916415d5] Images v0.17.3 [9b13fd28] IndirectArrays v0.5.0 [a98d9a8b] Interpolations v0.12.2 [8197267c] IntervalSets v0.3.1 [c8e1da08] IterTools v1.1.1 [682c06a0] JSON v0.20.0 [e5e0dc1b] Juno v0.7.0 [1914dd2f] MacroTools v0.5.0 [dbb5928d] MappedArrays v0.2.1 [e89f7d12] Media v0.5.0 [dbeba491] Metalhead v0.3.0 [e1d29d7a] Missings v0.4.1 [872c559c] NNlib v0.6.0 [77ba4419] NaNMath v0.3.2 [6fe1bfb0] OffsetArrays v0.11.0 [bac558e1] OrderedCollections v1.1.0 [5432bcbf] PaddedViews v0.4.2 [92933f4c] ProgressMeter v0.9.0 [b3c3ace0] RangeArrays v0.3.1 [c84ed2f1] Ratios v0.3.1 [189a3867] Reexport v0.2.0 [ae029012] Requires v0.5.2 [6038ab10] Rotations v0.11.1 [699a6c99] SimpleTraits v0.8.0 [a2af1166] SortingAlgorithms v0.3.1 [276daf66] SpecialFunctions v0.7.2 [90137ffa] StaticArrays v0.11.0 [2913bbd2] StatsBase v0.30.0 [06e1c1a7] TiledIteration v0.2.3 [a759f4b9] TimerOutputs v0.5.0 [0796e94c] Tokenize v0.5.4 [9f7883ad] Tracker v0.2.2 [3bb67fe8] TranscodingStreams v0.9.4 [30578b45] URIParser v0.4.0 [81def892] VersionParsing v1.1.3 [efce3f68] WoodburyMatrices v0.4.1 [a5390f91] ZipFile v0.8.3 [2a0f44e3] Base64 [@stdlib/Base64] [ade2ca70] Dates [@stdlib/Dates] [8bb1440f] DelimitedFiles [@stdlib/DelimitedFiles] [8ba89e20] Distributed [@stdlib/Distributed] [b77e0a4c] InteractiveUtils [@stdlib/InteractiveUtils] [76f85450] LibGit2 [@stdlib/LibGit2] [8f399da3] Libdl [@stdlib/Libdl] [37e2e46d] LinearAlgebra [@stdlib/LinearAlgebra] [56ddb016] Logging [@stdlib/Logging] [d6f4376e] Markdown [@stdlib/Markdown] [a63ad114] Mmap [@stdlib/Mmap] [44cfe95a] Pkg [@stdlib/Pkg] [de0858da] Printf [@stdlib/Printf] [9abbd945] Profile [@stdlib/Profile] [3fa0cd96] REPL [@stdlib/REPL] [9a3f8284] Random [@stdlib/Random] [ea8e919c] SHA [@stdlib/SHA] [9e88b42a] Serialization [@stdlib/Serialization] [1a1011a3] SharedArrays [@stdlib/SharedArrays] [6462fe0b] Sockets [@stdlib/Sockets] [2f01184e] SparseArrays [@stdlib/SparseArrays] [10745b16] Statistics [@stdlib/Statistics] [8dfed614] Test [@stdlib/Test] [cf7118a7] UUIDs [@stdlib/UUIDs] [4ec0a83e] Unicode [@stdlib/Unicode] ERROR: LoadError: MethodError: no method matching maxpool(::Array{Float32,4}, ::Tuple{Int64,Int64}) Closest candidates are: maxpool(::AbstractArray{xT,N}, ::NNlib.PoolDims; kwargs...) where {xT, N} at /usr/home/sut/.julia/packages/TimerOutput>s/7zSea/src/TimerOutput.jl:198 Stacktrace: [1] (::getfield(Metalhead, Symbol("##42#48")))(::Array{Float32,4}) at /usr/home/sut/.julia/packages/Metalhead/fYeSU/src>/vgg19.jl:6 [2] applychain(::Tuple{getfield(Metalhead, Symbol("##42#48")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##43#49")),Fl>ux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##44#50")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##45#51")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##46#52")),getfield(Metalhead, Symbol("##47#53")),Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(identity),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},typeof(NNlib.softmax)}, ::Array{Float32,4}) at /usr/home/sut/.julia/packages/Flux/qXNjB/src/layers/basic.jl:31 (repeats 3 times) [3] (::Flux.Chain{Tuple{Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##42#48")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##43#49")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##44#50")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##45#51")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##46#52")),getfield(Metalhead, Symbol("##47#53")),Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(identity),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},typeof(NNlib.softmax)}})(::Array{Float32,4}) at /usr/home/sut/.julia/packages/Flux/qXNjB/src/layers/basic.jl:33 [4] (::VGG19)(::Array{Float32,4}) at /usr/home/sut/.julia/packages/Metalhead/fYeSU/src/vgg19.jl:46 [5] top-level scope at none:0 [6] include at ./boot.jl:326 [inlined] [7] include_relative(::Module, ::String) at ./loading.jl:1038 [8] include(::Module, ::String) at ./sysimg.jl:29 [9] include(::String) at ./client.jl:403 [10] top-level scope at none:0 in expression starting at /usr/home/sut/.julia/packages/Metalhead/fYeSU/test/runtests.jl:7 ERROR: Package Metalhead errored during testing

i believe problem lies in the ONNX.jl . here are the test results for ONNX.jl

(v1.1) pkg> test ONNX Testing ONNX Status /tmp/tmpnyOZv0/Manifest.toml [1520ce14] AbstractTrees v0.2.1 [79e6a3ab] Adapt v0.4.2 [fbb218c0] BSON v0.2.3 [9e28174c] BinDeps v0.8.10 [b99e7846] BinaryProvider v0.5.4 [00ebfdb7] CSTParser v0.6.0 [944b1d66] CodecZlib v0.5.2 [3da002f7] ColorTypes v0.8.0 [5ae59095] Colors v0.9.5 [bbf7d656] CommonSubexpressions v0.2.0 [34da2185] Compat v2.1.0 [a8cc5b0e] Crayons v4.0.0 [a237f610] DataFlow v0.5.0 [864edb3b] DataStructures v0.15.0 [163ba53b] DiffResults v0.0.4 [b552c78f] DiffRules v0.0.10 [53c48c17] FixedPointNumbers v0.5.3 [587475ba] Flux v0.8.3 [f6369f11] ForwardDiff v0.10.3 [e5e0dc1b] Juno v0.7.0 [50d2b5c4] Lazy v0.13.2 [1914dd2f] MacroTools v0.5.0 [e89f7d12] Media v0.5.0 [e1d29d7a] Missings v0.4.1 [872c559c] NNlib v0.6.0 [77ba4419] NaNMath v0.3.2 [d0dd6a25] ONNX v0.1.0 [bac558e1] OrderedCollections v1.1.0 [3349acd9] ProtoBuf v0.7.0 [189a3867] Reexport v0.2.0 [ae029012] Requires v0.5.2 [a2af1166] SortingAlgorithms v0.3.1 [276daf66] SpecialFunctions v0.7.2 [90137ffa] StaticArrays v0.11.0 [2913bbd2] StatsBase v0.30.0 [a759f4b9] TimerOutputs v0.5.0 [0796e94c] Tokenize v0.5.4 [9f7883ad] Tracker v0.2.2 [3bb67fe8] TranscodingStreams v0.9.4 [30578b45] URIParser v0.4.0 [a5390f91] ZipFile v0.8.3 [2a0f44e3] Base64 [@stdlib/Base64] [ade2ca70] Dates [@stdlib/Dates] [8bb1440f] DelimitedFiles [@stdlib/DelimitedFiles] [8ba89e20] Distributed [@stdlib/Distributed] [b77e0a4c] InteractiveUtils [@stdlib/InteractiveUtils] [76f85450] LibGit2 [@stdlib/LibGit2] [8f399da3] Libdl [@stdlib/Libdl] [37e2e46d] LinearAlgebra [@stdlib/LinearAlgebra] [56ddb016] Logging [@stdlib/Logging] [d6f4376e] Markdown [@stdlib/Markdown] [a63ad114] Mmap [@stdlib/Mmap] [44cfe95a] Pkg [@stdlib/Pkg] [de0858da] Printf [@stdlib/Printf] [9abbd945] Profile [@stdlib/Profile] [3fa0cd96] REPL [@stdlib/REPL] [9a3f8284] Random [@stdlib/Random] [ea8e919c] SHA [@stdlib/SHA] [9e88b42a] Serialization [@stdlib/Serialization] [1a1011a3] SharedArrays [@stdlib/SharedArrays] [6462fe0b] Sockets [@stdlib/Sockets] [2f01184e] SparseArrays [@stdlib/SparseArrays] [10745b16] Statistics [@stdlib/Statistics] [8dfed614] Test [@stdlib/Test] [cf7118a7] UUIDs [@stdlib/UUIDs] [4ec0a83e] Unicode [@stdlib/Unicode] WARNING: Method definition iterate(DataFlow.ObjectArraySet{T} where T, Any...) in module DataFlow at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285 overwritten at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285. WARNING: Method definition iterate(DataFlow.ObjectArraySet{T} where T, Any...) in module DataFlow at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285 overwritten at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285. WARNING: Method definition iterate(DataFlow.ObjectArraySet{T} where T, Any...) in module DataFlow at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285 overwritten at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285. WARNING: Method definition iterate(DataFlow.ObjectArraySet{T} where T, Any...) in module DataFlow at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285 overwritten at /usr/home/sut/.julia/packages/Lazy/ZAeCx/src/macros.jl:285. Downloading test data.... Cloning into 'onnx'... remote: Enumerating objects: 2, done. remote: Counting objects: 100% (2/2), done. remote: Compressing objects: 100% (2/2), done. remote: Total 17762 (delta 0), reused 1 (delta 0), pack-reused 17760 Receiving objects: 100% (17762/17762), 9.13 MiB | 4.94 MiB/s, done. Resolving deltas: 100% (9608/9608), done. Checking connectivity... done. ONNX: Test Failed at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/ops_tests.jl:114 Expression: ≈(((ONNX.ops[Symbol(get_optype(read_model(filename)))])(get_dict(read_model(filename)), ip...) |> syntax) >|> eval, op_expected, atol=0.001) Evaluated: [2.15309 1.12259 1.54411 1.6154; 1.64039 1.84711 2.03664 2.05161; … ; 2.33234 1.45116 1.5357 1.60765; 2.19>2 1.64431 1.65682 1.1689]

[4.29606 3.0506 1.2262 1.22461; 0.660878 1.34998 0.97315 0.00713262; … ; 2.24321 -0.335784 3.64739 1.84095; -1.17126 -0.>263888 1.79627 1.74456]

[-1.44342 -0.984444 -1.32833 -0.333053; -1.7227 -1.59698 -0.364201 -0.605077; … ; 0.811567 -1.86846 -1.54272 -1.13199; ->1.03826 -0.815031 -0.676275 -0.927807]

[1.23718 1.33893 1.76404 1.23254; 1.3548 0.877154 1.53845 1.16262; … ; 0.841035 1.1489 1.02578 1.37285; 1.55666 1.50949 >1.64121 1.51108]

[2.72273 -0.747425 1.85892 0.600846; 0.38063 0.0655282 0.0160268 1.38995; … ; 3.14342 2.61572 0.294685 1.25798; -0.28530>6 0.206473 0.997859 0.946139]

[0.760724 0.806188 0.749002 -0.051775; -1.66837 -0.966058 0.0261059 0.0570868; … ; 0.0737359 0.790641 0.780959 -0.193403>; -1.53708 0.45801 -0.85658 0.038257] ≈ Float32[2.16028 1.12082 1.54601 1.61791; 1.64312 1.85164 2.04282 2.05791; … ; 2.>34109 1.45225 1.53752 1.6101; 2.19953 1.64708 1.65969 1.16753]

Float32[4.50685 3.20878 1.30733 1.30567; 0.718128 1.43634 1.04359 0.0367703; … ; 2.36729 -0.32063 3.83078 1.94804; -1.19>139 -0.245697 1.90147 1.84758]

Float32[-3.63249 -2.39693 -3.32265 -0.643395; -4.3843 -4.04586 -0.727244 -1.37568; … ; 2.4379 -4.7767 -3.8998 -2.79412; >-2.5418 -1.94087 -1.56734 -2.24446]

Float32[1.2364 1.33904 1.76784 1.23172; 1.35505 0.873248 1.5403 1.1612; … ; 0.836815 1.14736 1.02317 1.37325; 1.55866 1.>51108 1.64395 1.51268]

Float32[2.86707 -0.749657 1.96677 0.655561; 0.426044 0.0976323 0.0460402 1.47799; … ; 3.30553 2.75553 0.336468 1.34045; >-0.26802 0.24453 1.06934 1.01544]

Float32[2.30104 2.42342 2.26948 0.113802; -4.23805 -2.34743 0.323456 0.406856; … ; 0.451675 2.38157 2.35551 -0.267458; ->3.88461 1.48613 -2.05272 0.356166] (atol=0.001) Stacktrace: [1] main_test(::String, ::Array{Float32,4}, ::Array{Float32,4}, ::Vararg{Any,N} where N) at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/ops_tests.jl:114 [2] top-level scope at none:0 [3] include at ./boot.jl:326 [inlined] [4] include_relative(::Module, ::String) at ./loading.jl:1038 [5] include(::Module, ::String) at ./sysimg.jl:29 [6] include(::String) at ./client.jl:403 [7] top-level scope at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:9 [8] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083 [9] top-level scope at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:8 ONNX: Test Failed at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/ops_tests.jl:114 Expression: ≈(((ONNX.ops[Symbol(get_optype(read_model(filename)))])(get_dict(read_model(filename)), ip...) |> syntax) >|> eval, op_expected, atol=0.001) Evaluated: [-0.999992; 0.0; 0.999992]

[-0.355395; 1.0; 2.3554] ≈ Float32[-0.999995; 0.0; 0.999995]

Float32[-0.224741; 1.0; 2.22474] (atol=0.001) Stacktrace: [1] main_test(::String, ::Array{Float32,4}, ::Array{Float32,4}, ::Vararg{Any,N} where N) at /usr/home/sut/.julia/packag>es/ONNX/7ZopS/test/ops_tests.jl:114 [2] top-level scope at none:0 [3] include at ./boot.jl:326 [inlined] [4] include_relative(::Module, ::String) at ./loading.jl:1038 [5] include(::Module, ::String) at ./sysimg.jl:29 [6] include(::String) at ./client.jl:403 [7] top-level scope at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:9 [8] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083 [9] top-level scope at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:8 ONNX: Error During Test at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:6 Got exception outside of a @test LoadError: LoadError: MethodError: no method matching maxpool(::Array{Float32,4}, ::Tuple{Int64,Int64}; pad=(0, 0), st>ride=(1, 1)) Closest candidates are: maxpool(::AbstractArray{xT,N}, !Matched::PoolDims; kwargs...) where {xT, N} at /usr/home/sut/.julia/packages/TimerOu>tputs/7zSea/src/TimerOutput.jl:198 Stacktrace: [1] top-level scope at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/temp_maxpool.jl:2 [2] include at ./boot.jl:326 [inlined] [3] include_relative(::Module, ::String) at ./loading.jl:1038 [4] include(::Module, ::String) at ./sysimg.jl:29 [5] include(::String) at ./client.jl:403 [6] maintest(::String, ::Array{Float32,3}, ::Array{Float32,3}) at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/ops>tests.jl:78 [7] top-level scope at none:0 [8] include at ./boot.jl:326 [inlined] [9] include_relative(::Module, ::String) at ./loading.jl:1038 [10] include(::Module, ::String) at ./sysimg.jl:29 [11] include(::String) at ./client.jl:403 [12] top-level scope at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:11 [13] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Test/src/Test.jl:1083 [14] top-level scope at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:8 [15] include at ./boot.jl:326 [inlined] [16] include_relative(::Module, ::String) at ./loading.jl:1038 [17] include(::Module, ::String) at ./sysimg.jl:29 [18] include(::String) at ./client.jl:403 [19] top-level scope at none:0 [20] eval(::Module, ::Any) at ./boot.jl:328 [21] exec_options(::Base.JLOptions) at ./client.jl:243 [22] _start() at ./client.jl:436 in expression starting at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/temp_maxpool.jl:1 in expression starting at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/pooling.jl:6 Test Summary: | Pass Fail Error Total ONNX | 28 2 1 31 ERROR: LoadError: Some tests did not pass: 28 passed, 2 failed, 1 errored, 0 broken. in expression starting at /usr/home/sut/.julia/packages/ONNX/7ZopS/test/runtests.jl:6 ERROR: Package ONNX errored during testing

teddykoker commented 5 years ago

Try installing from the master branch:

] add Metalhead#master

From this issue it appears the current version is using maxpool, which is deprecated in favor of MaxPool.

This solved the issue for me. Hope this helps

julian43 commented 5 years ago

I also get an error when running the same example (in Linux Mint 19.2 and OS X Catalina):

MethodError: no method matching maxpool(::Array{Float32,4}, ::Tuple{Int64,Int64}) Closest candidates are: maxpool(::AbstractArray{xT,N}, !Matched::NNlib.PoolDims; kwargs...) where {xT, N} at /home/julian43/.julia/packages/TimerOutputs/7zSea/src/TimerOutput.jl:198

Stacktrace: [1] (::getfield(Metalhead, Symbol("##42#48")))(::Array{Float32,4}) at /home/julian43/.julia/packages/Metalhead/fYeSU/src/vgg19.jl:6 [2] applychain(::Tuple{getfield(Metalhead, Symbol("##42#48")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##43#49")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##44#50")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##45#51")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##46#52")),getfield(Metalhead, Symbol("##47#53")),Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(identity),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},typeof(NNlib.softmax)}, ::Array{Float32,4}) at /home/julian43/.julia/packages/Flux/dkJUV/src/layers/basic.jl:31 (repeats 3 times) [3] (::Flux.Chain{Tuple{Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##42#48")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##43#49")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##44#50")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##45#51")),Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},Flux.Conv{2,2,typeof(NNlib.relu),Array{Float32,4},Array{Float32,1}},getfield(Metalhead, Symbol("##46#52")),getfield(Metalhead, Symbol("##47#53")),Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(NNlib.relu),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},Flux.Dropout{Float32},Flux.Dense{typeof(identity),LinearAlgebra.Adjoint{Float32,Array{Float32,2}},Array{Float32,1}},typeof(NNlib.softmax)}})(::Array{Float32,4}) at /home/julian43/.julia/packages/Flux/dkJUV/src/layers/basic.jl:33 [4] (::VGG19)(::Array{Float32,4}) at /home/julian43/.julia/packages/Metalhead/fYeSU/src/vgg19.jl:46 [5] forward(::VGG19, ::Array{RGB{Normed{UInt8,8}},2}) at /home/julian43/.julia/packages/Metalhead/fYeSU/src/utils.jl:70 [6] classify(::VGG19, ::Array{RGB{Normed{UInt8,8}},2}) at /home/julian43/.julia/packages/Metalhead/fYeSU/src/utils.jl:98

DhairyaLGandhi commented 4 years ago

Could you try with the latest tagged? It should be resolved now

DilumAluthge commented 4 years ago

@dhairyagandhi96 Can this issue be closed now?

DhairyaLGandhi commented 4 years ago

Thank you!