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

AttributeError: 'module' object has no attribute 'SumSquare' #138

Closed
kohillyang opened this issue May 22, 2018 · 2 comments · Fixed by #191
Closed

AttributeError: 'module' object has no attribute 'SumSquare' #138

kohillyang opened this issue May 22, 2018 · 2 comments · Fixed by #191
Assignees

Comments

@kohillyang
Copy link

When I tried to use sync Batchnorm (only one gpu beacuse I failed to use multi-gpu by DataParallelCriterion ), I failed because it tells me "AttributeError: 'module' object has no attribute 'SumSquare'"

  File "/data1/zyx/yks/sources/gluon-cv/gluoncv/utils/parallel.py", line 53, in __call__
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 414, in __call__
    return self.forward(*args)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 620, in forward
    return self._call_cached_op(x, *args)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 525, in _call_cached_op
    self._build_cache(*args)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 481, in _build_cache
    inputs, out = self._get_graph(*args)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 473, in _get_graph
    out = self.hybrid_forward(symbol, *grouped_inputs, **params)  # pylint: disable=no-value-for-parameter
  File "/data1/zyx/yks/resnet38w/models/drn_gcn.py", line 97, in hybrid_forward
    fm0 = self.layer0(x)  # 256
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 414, in __call__
    return self.forward(*args)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 637, in forward
    return self.hybrid_forward(symbol, x, *args, **params)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/nn/basic_layers.py", line 117, in hybrid_forward
    x = block(x)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 414, in __call__
    return self.forward(*args)
  File "/data1/zyx/yks/sources/incubator-mxnet/python/mxnet/gluon/block.py", line 637, in forward
    return self.hybrid_forward(symbol, x, *args, **params)
  File "/data1/zyx/yks/sources/gluon-cv/gluoncv/model_zoo/syncbn.py", line 117, in hybrid_forward
AttributeError: 'module' object has no attribute 'SumSquare'

And here's the code for training:

            with ag.record():
                outputs =  net(data)
                losses = criterion(outputs,target,mask)
                mx.nd.waitall()
                ag.backward(losses)
@zhanghang1989 zhanghang1989 self-assigned this May 22, 2018
@zhanghang1989
Copy link
Contributor

If you would like to try Sync BatchNorm, please follow the instruction here https://github.com/zhanghang1989/MXNet-Gluon-SyncBN to compile a different branch of MXNet

@zhanghang1989
Copy link
Contributor

The Synchronized Batch Normalization will be available shortly. Currently in PR apache/mxnet#11502

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

Successfully merging a pull request may close this issue.

2 participants