Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with vl_nnaxpy? #5

Open
LavieLuo opened this issue Feb 26, 2019 · 3 comments
Open

Problem with vl_nnaxpy? #5

LavieLuo opened this issue Feb 26, 2019 · 3 comments

Comments

@LavieLuo
Copy link

This problem occurs when implementing the backward of SE-RestNet-50 in 'Axpy Layer'.

#--------------------------------------------------
dagnn.Layer/backwardAdvanced (line 124)
Invalid derivatives returned by layer "conv5_3".
#--------------------------------------------------

Part of the dagnn.Layer code:
[derInputs, derParams] = obj.backward ... (inputs, {net.params(par).value}, derOutputs) ; if ~iscell(derInputs) || numel(derInputs) ~= numel(in) error('Invalid derivatives returned by layer "%s".', layer.name); end

I checked the 'class' and 'numel' of [derInputs], it looks like the them are 'single' and '1' respectively.

Thus, I run
vl_contrib('test', 'mcnExtraLayers') ;

Same problem appears here,
#---------------------------------------------------------------------------------
Error nnaxpy/basic (line 15)
test.der(@(a) vl_nnaxpy(a, x1, x2), a, dzdy, dzdx{1}, 1e-3*test.range) ;
#---------------------------------------------------------------------------------
'dzdx' is not a 'cell', but a 'single';

Though I try to compel the output of [fun vl_nnaxpy] to be a cell by
y={y}

There is another problem that
#----------------------------------------------------------------------------------
Error nnaxpy/basic (line 16)
test.der(@(x1) vl_nnaxpy(a, x1, x2), x1, dzdy, dzdx{2}, 1e-4*test.range) ;
#----------------------------------------------------------------------------------
It looks like <size(dzdx) = 1>, and dzdx{2} beyond the index.

Could you help me? Thanks!

@sunzhen6251
Copy link

This problem occurs when implementing the backward of SE-RestNet-50 in 'Axpy Layer'.

#--------------------------------------------------
dagnn.Layer/backwardAdvanced (line 124)
Invalid derivatives returned by layer "conv5_3".
#--------------------------------------------------

Part of the dagnn.Layer code:
[derInputs, derParams] = obj.backward ... (inputs, {net.params(par).value}, derOutputs) ; if ~iscell(derInputs) || numel(derInputs) ~= numel(in) error('Invalid derivatives returned by layer "%s".', layer.name); end

I checked the 'class' and 'numel' of [derInputs], it looks like the them are 'single' and '1' respectively.

Thus, I run
vl_contrib('test', 'mcnExtraLayers') ;

Same problem appears here,
#---------------------------------------------------------------------------------
Error nnaxpy/basic (line 15)
test.der(@(a) vl_nnaxpy(a, x1, x2), a, dzdy, dzdx{1}, 1e-3*test.range) ;
#---------------------------------------------------------------------------------
'dzdx' is not a 'cell', but a 'single';

Though I try to compel the output of [fun vl_nnaxpy] to be a cell by
y={y}

There is another problem that
#----------------------------------------------------------------------------------
Error nnaxpy/basic (line 16)
test.der(@(x1) vl_nnaxpy(a, x1, x2), x1, dzdy, dzdx{2}, 1e-4*test.range) ;
#----------------------------------------------------------------------------------
It looks like <size(dzdx) = 1>, and dzdx{2} beyond the index.

Could you help me? Thanks!

I also encountered this problem. Have you solved it ?

@LavieLuo
Copy link
Author

@sunzhen6251
Not yet....
I can't handle this and then use pytorch instead of it.

@sunzhen6251
Copy link

@sunzhen6251
Not yet....
I can't handle this and then use pytorch instead of it.

OK...Thank you anyway... : )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants