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

mx.symbol.softmax_cross_entropy() raises error "Not enough argument to call operator softmax_cross_entropy" #6874

Open
SealLive opened this issue Jun 29, 2017 · 6 comments
Labels

Comments

@SealLive
Copy link

Environment info

Operating System:
This error was raised on Ubuntu 14.04, Windows 10 and Mac OS X El Capitan(10.11.6)

Compiler:
gcc / Visual Studio 2013 / clang-omp

Package used:
Python

MXNet version:
0.10.1(installed from source)

Python version and distribution:
2.7.6(installed by apt-get) for Ubuntu.
2.7.12(from python.org) for Windows and Mac OS.

Error Message:

(on Mac OS)

[00:31:44] /Users/Seal/mxnet/dmlc-core/include/dmlc/logging.h:304: [00:31:44] src/core/symbolic.cc:295: Not enough argument to call operator softmax_cross_entropy

Stack trace returned 5 entries:
[bt] (0) 0   libmxnet.so                         0x0000000103289da5 _ZN4dmlc15LogMessageFatalD2Ev + 37
[bt] (1) 1   libmxnet.so                         0x0000000104a46cf9 _ZN4nnvm6Symbol7ComposeERKN4dmlc10array_viewIPKS0_EERKNSt3__113unordered_mapINS8_12basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEES4_NS8_4hashISF_EENS8_8equal_toISF_EENSD_INS8_4pairIKSF_S4_EEEEEERSL_ + 8121
[bt] (2) 2   libmxnet.so                         0x0000000104a39911 NNSymbolCompose + 1345
[bt] (3) 3   _ctypes.so                          0x0000000100780417 ffi_call_unix64 + 79
[bt] (4) 4   ???                                 0x00007fff5fbfe6f0 0x0 + 140734799800048

Traceback (most recent call last):
  File "sm_ce_test.py", line 9, in <module>
    ce = mx.symbol.softmax_cross_entropy(data=data, label=label, name="sm")
  File "<string>", line 22, in softmax_cross_entropy
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mxnet-0.10.1-py2.7.egg/mxnet/_ctypes/symbol.py", line 120, in _symbol_creator
    s._compose(name=name, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mxnet-0.10.1-py2.7.egg/mxnet/symbol.py", line 449, in _compose
    self.handle, name, num_args, keys, args))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/mxnet-0.10.1-py2.7.egg/mxnet/base.py", line 85, in check_call
    raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: [00:31:44] src/core/symbolic.cc:295: Not enough argument to call operator softmax_cross_entropy

Stack trace returned 5 entries:
[bt] (0) 0   libmxnet.so                         0x0000000103289da5 _ZN4dmlc15LogMessageFatalD2Ev + 37
[bt] (1) 1   libmxnet.so                         0x0000000104a46cf9 _ZN4nnvm6Symbol7ComposeERKN4dmlc10array_viewIPKS0_EERKNSt3__113unordered_mapINS8_12basic_stringIcNS8_11char_traitsIcEENS8_9allocatorIcEEEES4_NS8_4hashISF_EENS8_8equal_toISF_EENSD_INS8_4pairIKSF_S4_EEEEEERSL_ + 8121
[bt] (2) 2   libmxnet.so                         0x0000000104a39911 NNSymbolCompose + 1345
[bt] (3) 3   _ctypes.so                          0x0000000100780417 ffi_call_unix64 + 79
[bt] (4) 4   ???                                 0x00007fff5fbfe6f0 0x0 + 140734799800048

Minimum reproducible example

(this code runs fine on MXNet 0.9.5, but not on 0.10.1)

import mxnet as mx

ctx = mx.gpu(0)
data = mx.symbol.Variable("data")
label = mx.symbol.Variable("label")
data_nd = mx.nd.array([[1,2,3],[2,3,4]],ctx)
label_nd = mx.nd.array([1,2],ctx)

ce = mx.symbol.softmax_cross_entropy(data=data, label=label, name="sm")
exe = ce.bind(ctx=ctx, args={"data":data_nd, "label":label_nd})
exe.forward()

Steps to reproduce

Just run the python code above.

@kevinthesun
Copy link
Contributor

This can be fixed by this PR: #6766

jonasrauber pushed a commit to bethgelab/foolbox that referenced this issue Jul 11, 2017
* added preprocessing_fn to pytorch model

* fixed tabs

* use mxnet 0.10.0 for now, because 0.10.1 is buggy

(apache/mxnet#6874)

* fixed pep8 violations

* added test for pytorch preprocessing support

* fixed test
jonasrauber pushed a commit to bethgelab/foolbox that referenced this issue Jul 21, 2017
* added preprocessing_fn to pytorch model

* fixed tabs

* use mxnet 0.10.0 for now, because 0.10.1 is buggy

(apache/mxnet#6874)

* fixed pep8 violations

* added test for pytorch preprocessing support

* fixed test

* Added elementwise preprocessing to all models

* Removed leftover copies from mxnet

* fixed hanging indent

* Updated toy example
@szha
Copy link
Member

szha commented Sep 30, 2017

This issue is closed due to lack of activity in the last 90 days. Feel free to ping me to reopen if this is still an active issue. Thanks!

@szha szha closed this as completed Sep 30, 2017
@pppoe
Copy link

pppoe commented Oct 13, 2017

I am using mxnet-cu80 (0.11.0rc3), the issue is reproducible with the same example code.

@jonasrauber
Copy link
Contributor

This error is still reproducible!

@leviswind
Copy link

This error is still reproducible on 1.3.0.

@satyakrishnagorti
Copy link
Contributor

satyakrishnagorti commented Jan 30, 2019

This is still an issue.

Steps to reproduce on mxnet 1.3.1.

data = mx.sym.Variable("data")
symbol = mx.syml.Variable("label")
# fails below
ce = mx.sym.softmax_cross_entropy(name="ce", data=data, label=label)

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

8 participants