Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

global name 'multiply' is not defined when using LBSGD #11278

Closed
xmfbit opened this issue Jun 14, 2018 · 4 comments
Closed

global name 'multiply' is not defined when using LBSGD #11278

xmfbit opened this issue Jun 14, 2018 · 4 comments
Labels

Comments

@xmfbit
Copy link

xmfbit commented Jun 14, 2018

When I use LBSGD, the error occurs that reminds me

   File "/home/me/anaconda/lib/python2.7/site-packages/mxnet/optimizer.py", line 758, in _l2norm
    norm = multiply(v, v).asnumpy().sum()
NameError: global name 'multiply' is not defined

I add this in the optimizer.py manually and have solved the problem. So is this a bug existing in MXNet?

from .ndarray import multiply

And I want to know whether the LBSGD optimizer is done or not in MXNet. Because I see this in https://github.com/apache/incubator-mxnet/blob/master/python/mxnet/optimizer.py#L734:

    def _get_lbmult(self, nup):
        """Returns lr scaling factor for large batch according to warmup schedule
        (to be implemented)
@kalyc
Copy link
Contributor

kalyc commented Jun 14, 2018

Thanks for submitting this issue @xmfbit
@sandeep-krishnamurthy could you add label "Question" to this issue?

@ThomasDelteil
Copy link
Contributor

ThomasDelteil commented Jul 5, 2018

@xmfbit I confirm there is indeed a bug with the 'lars' warmup strategy. I am not sure the optimizer has been properly tested, as that would have been picked up instantly
@ashokei could you follow up on that? Thanks!

~/anaconda3/lib/python3.6/site-packages/mxnet/optimizer.py in _l2norm(self, v)
    767     def _l2norm(self, v):
    768         "inner product implementation"
--> 769         norm = multiply(v, v).asnumpy().sum()
    770         return norm
    771 

NameError: name 'multiply' is not defined

@indhub can you remove [Question] and add [Bug] ? Thanks!

@indhub indhub added Bug and removed Question labels Jul 6, 2018
@vandanavk
Copy link
Contributor

the fix for this has been merged #12005. @xmfbit Please verify at your end too. Thanks

@vandanavk
Copy link
Contributor

@sandeep-krishnamurthy Please close this issue as the PR has been merged.

@xmfbit Please feel free to reopen this issue if you see it again

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

No branches or pull requests

6 participants