You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I implemented this CNN for Image Segmentation. I am getting the following issue.
`function leNet5()
return Chain(
convBlock(101,202),
MeanPool((5,5)),
convBlock(202,404),
MeanPool((5,5)),
flatten,
Dense(20,40),
Dense(40,80),
Dense(80,101))
end
It would be more helpful to check the documentation for flatten. You also probably only need a reshape in this case. I'm closing this issue for now, but feel free to ask usage questions on the julia lang slack on the #helpdesk channel. Thanks!
I implemented this CNN for Image Segmentation. I am getting the following issue.
`function leNet5()
return Chain(
convBlock(101,202),
MeanPool((5,5)),
convBlock(202,404),
MeanPool((5,5)),
flatten,
Dense(20,40),
Dense(40,80),
Dense(80,101))
end
m = leNet5()
p = params(m)
loss(x, y) = crossentropy(m(x), y)
opt = ADAM(0.001, (0.9, 0.8))
epochs = 10
@epochs epochs Flux.train!(loss, p, train_data, opt, cb = () -> println("training"))`
The Image Data is in the format WHCN.
Error:-
Stacktrace:
[1] macro expansion at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0 [inlined]
[2] _pullback(::Zygote.Context, ::typeof(flatten), ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:13
[3] applychain at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/layers/basic.jl:30 [inlined]
[4] _pullback(::Zygote.Context, ::typeof(Flux.applychain), ::Tuple{typeof(flatten),Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}}, ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0
[5] applychain at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/layers/basic.jl:30 [inlined]
[6] _pullback(::Zygote.Context, ::typeof(Flux.applychain), ::Tuple{MeanPool{2,4},typeof(flatten),Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}}, ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0
[7] applychain at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/layers/basic.jl:30 [inlined]
[8] _pullback(::Zygote.Context, ::typeof(Flux.applychain), ::Tuple{Chain{Tuple{Conv{2,2,typeof(identity),Array{Float32,4},Array{Float32,1}},getfield(Main, Symbol("##101#102"))}},MeanPool{2,4},typeof(flatten),Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}}, ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0
[9] applychain at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/layers/basic.jl:30 [inlined]
[10] _pullback(::Zygote.Context, ::typeof(Flux.applychain), ::Tuple{MeanPool{2,4},Chain{Tuple{Conv{2,2,typeof(identity),Array{Float32,4},Array{Float32,1}},getfield(Main, Symbol("##101#102"))}},MeanPool{2,4},typeof(flatten),Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}}, ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0
[11] applychain at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/layers/basic.jl:30 [inlined]
[12] _pullback(::Zygote.Context, ::typeof(Flux.applychain), ::Tuple{Chain{Tuple{Conv{2,2,typeof(identity),Array{Float32,4},Array{Float32,1}},getfield(Main, Symbol("##101#102"))}},MeanPool{2,4},Chain{Tuple{Conv{2,2,typeof(identity),Array{Float32,4},Array{Float32,1}},getfield(Main, Symbol("##101#102"))}},MeanPool{2,4},typeof(flatten),Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}}, ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0
[13] Chain at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/layers/basic.jl:32 [inlined]
[14] _pullback(::Zygote.Context, ::Chain{Tuple{Chain{Tuple{Conv{2,2,typeof(identity),Array{Float32,4},Array{Float32,1}},getfield(Main, Symbol("##101#102"))}},MeanPool{2,4},Chain{Tuple{Conv{2,2,typeof(identity),Array{Float32,4},Array{Float32,1}},getfield(Main, Symbol("##101#102"))}},MeanPool{2,4},typeof(flatten),Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}},Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}}}, ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0
[15] loss at ./In[41]:4 [inlined]
[16] _pullback(::Zygote.Context, ::typeof(loss), ::Array{Float32,4}, ::Array{Float32,4}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface2.jl:0
[17] adjoint(::Zygote.Context, ::typeof(Core._apply), ::Function, ::Tuple{Array{Float32,4},Array{Float32,4}}) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/lib/lib.jl:168
[18] _pullback(::Zygote.Context, ::getfield(Flux.Optimise, Symbol("##17#25")){typeof(loss)}) at /home/jupyterlab/.julia/packages/ZygoteRules/OjfTt/src/adjoint.jl:57
[19] pullback(::Function, ::Params) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface.jl:172
[20] gradient(::Function, ::Params) at /home/jupyterlab/.julia/packages/Zygote/1GXzF/src/compiler/interface.jl:53
[21] macro expansion at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/optimise/train.jl:87 [inlined]
[22] macro expansion at /home/jupyterlab/.julia/packages/Juno/n6wyj/src/progress.jl:134 [inlined]
[23] #train!#12(::getfield(Main, Symbol("##121#125")), ::Function, ::typeof(loss), ::Params, ::Flux.Data.DataLoader, ::ADAM) at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/optimise/train.jl:80
[24] (::getfield(Flux.Optimise, Symbol("#kw##train!")))(::NamedTuple{(:cb,),Tuple{getfield(Main, Symbol("##121#125"))}}, ::typeof(Flux.Optimise.train!), ::Function, ::Params, ::Flux.Data.DataLoader, ::ADAM) at ./none:0
[25] top-level scope at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/optimise/train.jl:120
[26] top-level scope at /home/jupyterlab/.julia/packages/Juno/n6wyj/src/progress.jl:134
[27] top-level scope at In[64]:1
The text was updated successfully, but these errors were encountered: