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
m = leNet5()
p = params(m)
loss(x, y) = crossentropy(m(x), y)
opt = ADAM(p)
epochs = 10`
Error:-
MethodError: Cannot convert an object of type Params to an object of type Float64
Closest candidates are:
convert(::Type{Float64}, ::LLVM.ConstantFP) at /home/jupyterlab/.julia/packages/LLVM/KITdB/src/core/value/constant.jl:85
convert(::Type{T<:AbstractFloat}, ::Ratios.SimpleRatio{S}) where {T<:AbstractFloat, S} at /home/jupyterlab/.julia/packages/Ratios/uRs4y/src/Ratios.jl:14
convert(::Type{T<:Number}, ::T<:Number) where T<:Number at number.jl:6
...
Stacktrace:
[1] ADAM(::Params, ::Tuple{Float64,Float64}, ::IdDict{Any,Any}) at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/optimise/optimisers.jl:159
[2] ADAM(::Params, ::Tuple{Float64,Float64}) at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/optimise/optimisers.jl:164 (repeats 2 times)
[3] top-level scope at
The text was updated successfully, but these errors were encountered:
Usage questions on the package are better asked on discourse instead of here.
The problem in your example is that you don't have to feed the params to the optimizer.
Please check the documentation.
This is my model, a CNN for Image segmentation. I wrote after an article from this:- https://dev.to/yunshu67/lenet-implementation-for-cell-segmentation-105e
But I am getting an error as mentioned after the code.
`function leNet5()
return Chain(
convBlock(10,10),
MeanPool((5,5)),
convBlock(20,20),
MeanPool((5,5)),
flatten,
Dense(20,40),
Dense(40,80),
Dense(80,100))
end
m = leNet5()
p = params(m)
loss(x, y) = crossentropy(m(x), y)
opt = ADAM(p)
epochs = 10`
Error:-
Stacktrace:
[1] ADAM(::Params, ::Tuple{Float64,Float64}, ::IdDict{Any,Any}) at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/optimise/optimisers.jl:159
[2] ADAM(::Params, ::Tuple{Float64,Float64}) at /home/jupyterlab/.julia/packages/Flux/NpkMm/src/optimise/optimisers.jl:164 (repeats 2 times)
[3] top-level scope at
The text was updated successfully, but these errors were encountered: