Struct contents reference from a non-struct array object.
Error in solver.adam (line 62)
state.m = opts.beta1 * state.m + (1 - opts.beta1) * grad ;
Error in cnn_train_dag_ridge>accumulateGradients (line 375)
params.solver(net.params(p).value, state.solverState{p}, ...
Error in cnn_train_dag_ridge>processEpoch (line 282)
state = accumulateGradients(net, state, params, batchSize, parserv) ;
Error in cnn_train_dag_ridge (line 114)
[net, state, ders_iter(:,epoch)] = processEpoch(net, input, state, params, 'train') ;
I find that the params.solver is @solver.adam but the state.solverState{p} is blank in the below code. The code of initialize the state is enabled when the params.solver is empty.
if isempty(params.solver)
if isempty(state.solverState{p})
state.solverState{p} = zeros(size(parDer), 'like', parDer);
end
state.solverState{p} = vl_taccum(...
params.solverOpts.momentum, state.solverState{p}, ...
- (1 / batchSize), parDer) ;
net.params(p).value = vl_taccum(...
(1 - thisLR * thisDecay / (1 - params.solverOpts.momentum)), ...
net.params(p).value, ...
thisLR, state.solverState{p}) ;
else
grad = (1 / batchSize) * parDer + thisDecay * net.params(p).value;
% call solver function to update weights
[net.params(p).value, state.solverState{p}] = ...
params.solver(net.params(p).value, state.solverState{p}, ...
grad, params.solverOpts, thisLR) ;
end
so it cause a error when calling params.solver().
how should I fix it ?
The error like this :
I find that the params.solver is @solver.adam but the state.solverState{p} is blank in the below code. The code of initialize the state is enabled when the params.solver is empty.
so it cause a error when calling params.solver(). how should I fix it ?
Thanks !