model-zoo icon indicating copy to clipboard operation
model-zoo copied to clipboard

no method matching maxpool(::TrackedArray, ::Tuple)

Open cossio opened this issue 6 years ago • 6 comments

On this line:

https://github.com/FluxML/model-zoo/blob/42967f6767beee4092348fd41b1af33442b75924/vision/mnist/conv.jl#L69

I get the following error:

ERROR: MethodError: no method matching maxpool(::TrackedArray{…,Array{Float32,4}}, ::Tuple{Int64,Int64})
Closest candidates are:
  maxpool(::TrackedArray, ::PoolDims; kw...) at /opt/julia-depot/packages/Tracker/RRYy6/src/lib/array.jl:446
  maxpool(::AbstractArray{xT,N}, ::PoolDims; kwargs...) where {xT, N} at /opt/julia-depot/packages/TimerOutputs/7zSea/src/TimerOutput.jl:198
Stacktrace:
 [1] (::getfield(Main, Symbol("##5#9")))(::TrackedArray{…,Array{Float32,4}}) at ./REPL[28]:4
 [2] applychain(::Tuple{getfield(Main, Symbol("##5#9")),Conv{2,2,typeof(relu),TrackedArray{…,Array{Float32,4}},TrackedArray{…,Array{Float32,1}}},getfield(Main, Symbol("##6#10")),Conv{2,2,typeof(relu),TrackedArray{…,Array{Float32,4}},TrackedArray{…,Array{Float32,1}}},getfield(Main, Symbol("##7#11")),getfield(Main, Symbol("##8#12")),Dense{typeof(identity),TrackedArray{…,Array{Float32,2}},TrackedArray{…,Array{Float32,1}}},typeof(softmax)}, ::TrackedArray{…,Array{Float32,4}}) at /opt/julia depot/packages/Flux/qXNjB/src/layers/basic.jl:31 (repeats 2 times)
 [3] (::Chain{Tuple{Conv{2,2,typeof(relu),TrackedArray{…,Array{Float32,4}},TrackedArray{…,Array{Float32,1}}},getfield(Main, Symbol("##5#9")),Conv{2,2,typeof(relu),TrackedArray{…,Array{Float32,4}},TrackedArray{…,Array{Float32,1}}},getfield(Main, Symbol("##6#10")),Conv{2,2,typeof(relu),TrackedArray{…,Array{Float32,4}},TrackedArray{…,Array{Float32,1}}},getfield(Main, Symbol("##7#11")),getfield(Main, Symbol("##8#12")),Dense{typeof(identity),TrackedArray{…,Array{Float32,2}},TrackedArray{…,Array{Float32,1}}},typeof(softmax)}})(::Array{Float32,4}) at /opt/julia-depot/packages/Flux/qXNjB/src/layers/basic.jl:33
 [4] top-level scope at none:0

cossio avatar Jul 29 '19 19:07 cossio

I see. The issue is then that the example uses an earlier version of Flux. I'm not interested in just running the example but in learning about Flux. Do you know how I can fix this error? What's the syntax I should use now for maxpool?

cossio avatar Jul 29 '19 20:07 cossio

Thank you!

cossio avatar Jul 29 '19 21:07 cossio

Good to be closed now?

DhairyaLGandhi avatar Aug 19 '19 10:08 DhairyaLGandhi

@dhairyagandhi96 I'd wait for https://github.com/FluxML/model-zoo/pull/150 to be merged.

cossio avatar Aug 19 '19 12:08 cossio