Skip to content

Commit

Permalink
no such method => modified function args
Browse files Browse the repository at this point in the history
ERROR: MethodError: no method matching mapreduce(::getfield(MXNet.mx, Symbol("#apache#8072#8073")), ::typeof(+), ::Float64, ::Array{NDArray{Float32,1},1})
  • Loading branch information
phinzphinz committed Oct 24, 2019
1 parent ef56334 commit 86bcbe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion julia/src/metric.jl
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ end

function get(metric::MSE)
# Delay copy until last possible moment
mse_sum = mapreduce(nda->copy(nda)[1], +, 0.0, metric.mse_sum)
mse_sum = mapreduce(nda->copy(nda)[1], +, metric.mse_sum)
[(:MSE, mse_sum / metric.n_sample)]
end

Expand Down

1 comment on commit 86bcbe0

@phinzphinz
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The regression example did not run:

[ Info: Start training on Context[CPU0]                                     
[ Info: Initializing parameters...                                          
[ Info: Creating KVStore...                                                 
[ Info: TempSpace: Total 0 MB allocated on CPU0                             
[ Info: Start training...                                                   
ERROR: MethodError: no method matching mapreduce(::getfield(MXNet.mx, Symbol
("##8072#8073")), ::typeof(+), ::Float64, ::Array{NDArray{Float32,1},1})    
Closest candidates are:                                                     
mapreduce(::Any, ::Any, ::Number) at reduce.jl:324                          
mapreduce(::Any, ::Any, ::Any; kw...) at reduce.jl:205                      
mapreduce(::Any, ::Any, ::Base.SkipMissing{#s623} where #s623<:AbstractArray) at missing.jl:202  
Stacktrace:                     
[1] get(::MSE{1}) at /home/peter/.julia/packages/MXNet/XoVCW/src/metric.jl:263
[2] #fit#8164(::Base.Iterators.Pairs{Symbol,Any,NTuple{5,Symbol},NamedTuple{(:initializer, :eval_metric, :eval_data, :n_epoch, :callbacks),Tuple{NormalInitializer,MSE{1},ArrayDataProvider{Float32,2},Int64,Array{MXNet.mx.BatchCallback,1}}}}, ::Function, ::FeedForward, ::ADAM, ::ArrayDataProvider{Float32,2}) at /home/peter/.julia/packages/MXNet/XoVCW/src/model.jl:545                                               
[3] (::getfield(MXNet.mx, Symbol("#kw##fit")))(::NamedTuple{(:initializer, :eval_metric, :eval_data, :n_epoch, :callbacks),Tuple{NormalInitializer,MSE{1},ArrayDataProvider{Float32,2},Int64,Array{MXNet.mx.BatchCallback,1}}}, ::typeof(MXNet.mx.fit), ::FeedForward, ::ADAM, ::ArrayDataProvider{Float32,2}) at ./none:0

Please sign in to comment.