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

example/ssd error:Operator Scale is not registered #4720

Closed
guo253 opened this issue Jan 18, 2017 · 15 comments
Closed

example/ssd error:Operator Scale is not registered #4720

guo253 opened this issue Jan 18, 2017 · 15 comments

Comments

@guo253
Copy link

guo253 commented Jan 18, 2017

@zhreshold
For bugs or installation issues, please provide the following information.
The more information you provide, the more likely people will be able to help you.

Environment info

Operating System:
ubuntu 14.04
Compiler:
g++ 4.8.4
gcc 4.8.4
Package used (Python/R/Scala/Julia):
Python
MXNet version:
0.9.2 download 2017.1.17
CUDA = 0(only for cpu)
Python version and distribution:
2.7

EXTRA_OPERATORS = example/ssd/operator

Error Message:

python demo.py --epoch 0 --images ./data/demo/dog.jpg --thresh 0.5 --cpu
[22:24:20] include/dmlc/./logging.h:300: [22:24:20] src/core/op.cc:55: Check failed: op != nullptr Operator Scale is not registered

Stack trace returned 34 entries:
[bt] (0) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm2Op3GetERKSs+0x376) [0x7fd1584c2c06]
[bt] (1) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(+0x1859608) [0x7fd15850a608]
[bt] (2) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4dmlc20JSONObjectReadHelper13ReadAllFieldsEPNS_10JSONReaderE+0x110) [0x7fd1585111c0]
[bt] (3) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(+0x1857881) [0x7fd158508881]
[bt] (4) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(ZNSt17_Function_handlerIFN4nnvm5GraphES1_EPS2_E9_M_invokeERKSt9_Any_dataS1+0x11f) [0x7fd157884dbf]
[bt] (5) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm11ApplyPassesENS_5GraphERKSt6vectorISsSaISsEE+0x703) [0x7fd1584c8fc3]
[bt] (6) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN5mxnet18LoadLegacyJSONPassEN4nnvm5GraphE+0x18b) [0x7fd15788118b]
[bt] (7) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(ZNSt17_Function_handlerIFN4nnvm5GraphES1_EPS2_E9_M_invokeERKSt9_Any_dataS1+0x11f) [0x7fd157884dbf]
[bt] (8) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm11ApplyPassesENS_5GraphERKSt6vectorISsSaISsEE+0x703) [0x7fd1584c8fc3]
[bt] (9) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm9ApplyPassENS_5GraphERKSs+0x8e) [0x7fd15778e01e]
[bt] (10) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(MXSymbolCreateFromFile+0x471) [0x7fd1577873c1]
[bt] (11) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7fd15c558adc]
[bt] (12) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x1fc) [0x7fd15c55840c]
[bt] (13) /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(_ctypes_callproc+0x48e) [0x7fd15c76f5fe]
[bt] (14) /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(+0x15f9e) [0x7fd15c770f9e]
[bt] (15) python(PyEval_EvalFrameEx+0x965) [0x499be5]
[bt] (16) python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[bt] (17) python(PyEval_EvalFrameEx+0x18c5) [0x49ab45]
[bt] (18) python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[bt] (19) python(PyEval_EvalFrameEx+0x18c5) [0x49ab45]
[bt] (20) python() [0x4a1c9a]
[bt] (21) python() [0x4dfe94]
[bt] (22) python(PyObject_Call+0x36) [0x505f96]
[bt] (23) python() [0x4de41a]
[bt] (24) python() [0x5039eb]
[bt] (25) python(PyEval_EvalFrameEx+0x965) [0x499be5]
[bt] (26) python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[bt] (27) python(PyEval_EvalFrameEx+0x7d2) [0x499a52]
[bt] (28) python() [0x4a1634]
[bt] (29) python(PyRun_FileExFlags+0x92) [0x44e4a5]
[bt] (30) python(PyRun_SimpleFileExFlags+0x2ee) [0x44ec9f]
[bt] (31) python(Py_Main+0xb5e) [0x44f904]
[bt] (32) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fd15da25ec5]
[bt] (33) python() [0x578c4e]

Traceback (most recent call last):
File "demo.py", line 95, in
ctx, args.nms_thresh, args.force_nms)
File "demo.py", line 41, in get_detector
data_shape, mean_pixels, ctx=ctx)
File "/home/guorui/soft/code/mxnet/mxnet/example/ssd/detect/detector.py", line 34, in init
_, args, auxs = mx.model.load_checkpoint(model_prefix, epoch)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/model.py", line 372, in load_checkpoint
symbol = sym.load('%s-symbol.json' % prefix)
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/symbol.py", line 1056, in load
check_call(_LIB.MXSymbolCreateFromFile(c_str(fname), ctypes.byref(handle)))
File "/usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/base.py", line 75, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))
mxnet.base.MXNetError: Failed loading Op relu4_3_scale_20 of type Scale: [22:24:20] src/core/op.cc:55: Check failed: op != nullptr Operator Scale is not registered

Stack trace returned 34 entries:
[bt] (0) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm2Op3GetERKSs+0x376) [0x7fd1584c2c06]
[bt] (1) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(+0x1859608) [0x7fd15850a608]
[bt] (2) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4dmlc20JSONObjectReadHelper13ReadAllFieldsEPNS_10JSONReaderE+0x110) [0x7fd1585111c0]
[bt] (3) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(+0x1857881) [0x7fd158508881]
[bt] (4) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(ZNSt17_Function_handlerIFN4nnvm5GraphES1_EPS2_E9_M_invokeERKSt9_Any_dataS1+0x11f) [0x7fd157884dbf]
[bt] (5) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm11ApplyPassesENS_5GraphERKSt6vectorISsSaISsEE+0x703) [0x7fd1584c8fc3]
[bt] (6) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN5mxnet18LoadLegacyJSONPassEN4nnvm5GraphE+0x18b) [0x7fd15788118b]
[bt] (7) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(ZNSt17_Function_handlerIFN4nnvm5GraphES1_EPS2_E9_M_invokeERKSt9_Any_dataS1+0x11f) [0x7fd157884dbf]
[bt] (8) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm11ApplyPassesENS_5GraphERKSt6vectorISsSaISsEE+0x703) [0x7fd1584c8fc3]
[bt] (9) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(_ZN4nnvm9ApplyPassENS_5GraphERKSs+0x8e) [0x7fd15778e01e]
[bt] (10) /usr/local/lib/python2.7/dist-packages/mxnet-0.9.2-py2.7.egg/mxnet/libmxnet.so(MXSymbolCreateFromFile+0x471) [0x7fd1577873c1]
[bt] (11) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7fd15c558adc]
[bt] (12) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x1fc) [0x7fd15c55840c]
[bt] (13) /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(_ctypes_callproc+0x48e) [0x7fd15c76f5fe]
[bt] (14) /usr/lib/python2.7/lib-dynload/_ctypes.x86_64-linux-gnu.so(+0x15f9e) [0x7fd15c770f9e]
[bt] (15) python(PyEval_EvalFrameEx+0x965) [0x499be5]
[bt] (16) python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[bt] (17) python(PyEval_EvalFrameEx+0x18c5) [0x49ab45]
[bt] (18) python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[bt] (19) python(PyEval_EvalFrameEx+0x18c5) [0x49ab45]
[bt] (20) python() [0x4a1c9a]
[bt] (21) python() [0x4dfe94]
[bt] (22) python(PyObject_Call+0x36) [0x505f96]
[bt] (23) python() [0x4de41a]
[bt] (24) python() [0x5039eb]
[bt] (25) python(PyEval_EvalFrameEx+0x965) [0x499be5]
[bt] (26) python(PyEval_EvalCodeEx+0x2ac) [0x4a090c]
[bt] (27) python(PyEval_EvalFrameEx+0x7d2) [0x499a52]
[bt] (28) python() [0x4a1634]
[bt] (29) python(PyRun_FileExFlags+0x92) [0x44e4a5]
[bt] (30) python(PyRun_SimpleFileExFlags+0x2ee) [0x44ec9f]
[bt] (31) python(Py_Main+0xb5e) [0x44f904]
[bt] (32) /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7fd15da25ec5]
[bt] (33) python() [0x578c4e]

Thank you!

@piiswrong
Copy link
Contributor

Please use example/ssd
The ssd in @zhreshold 's repo is not working anymore

@guo253
Copy link
Author

guo253 commented Jan 19, 2017

@piiswrong @zhreshold
I indeed use example/ssd,and download 20170119.
This time I use CUDA=1.
There is still the error.

config.mk:
#EXTRA_OPERATORS =
EXTRA_OPERATORS = example/ssd/operator

Error Msg:
~/soft/code/mxnet/mxnet/example/ssd$ python demo.py
[12:19:34] include/dmlc/./logging.h:300: [12:19:34] src/core/op.cc:55: Check failed: op != nullptr Operator Scale is not registered

@zhreshold
Copy link
Member

@guo253 There is no more Scale operator in mxnet, are you mixing code in this repo with my repo?

@guo253
Copy link
Author

guo253 commented Jan 19, 2017

@zhreshold
I just use the ssd_300_voc_0712.zip from your repo.
Maybe that is the problem.
Thank you.

@HengjLi
Copy link

HengjLi commented Mar 13, 2017

Why removing scale operator in mxnet? I want to convert a trained caffe model (vggm) to a mxnet model. If there is no equivalent op in mxnet, what's the right conversion rule?

@zhreshold
Copy link
Member

@masterlee15 Because scale op is simply a broadcast_mul op. Use a mx.sym.Variable to hold the parameters of the scales instead.

@demingbh
Copy link

@zhreshold
Copy link
Member

@demingbh Should have been fixed, plz try again

@wengyc
Copy link

wengyc commented Mar 24, 2017

@zhreshold I redownload the mxnet today and make and setup.The model ssd_300.zip was also downloaded followed the link in example/ssd page.I run the demo.py without any modification and it has the same error.I want to know if the code need to be modified or i do something wrong with it.
Traceback (most recent call last): File "demo.py", line 96, in <module> ctx, args.nms_thresh, args.force_nms) File "demo.py", line 42, in get_detector data_shape, mean_pixels, ctx=ctx) File "/home/wyc/mxnet/example/ssd/detect/detector.py", line 34, in __init__ _, args, auxs = mx.model.load_checkpoint(model_prefix, epoch) File "/home/wyc/mxnet/python/mxnet/model.py", line 373, in load_checkpoint symbol = sym.load('%s-symbol.json' % prefix) File "/home/wyc/mxnet/python/mxnet/symbol.py", line 1215, in load check_call(_LIB.MXSymbolCreateFromFile(c_str(fname), ctypes.byref(handle))) File "/home/wyc/mxnet/python/mxnet/base.py", line 78, in check_call raise MXNetError(py_str(_LIB.MXGetLastError())) mxnet.base.MXNetError: Failed loading Op relu4_3_scale_20 of type Scale: [19:44:52] src/core /op.cc:55: Check failed: op != nullptr Operator Scale is not registered
Please help me.
Thank you!

@zhreshold
Copy link
Member

@wengyc I guess you have downloaded the model from zhreshold/mxnet-ssd, the model for mxnet/example/ssd don't have Scale and relu4_3_scale_20 inside. I have double checked the new model agian.

@wengyc
Copy link

wengyc commented Mar 25, 2017

@zhreshold I has a new error.
` Traceback (most recent call last):

File "demo.py", line 96, in ctx, args.nms_thresh, args.force_nms)

File "demo.py", line 42, in get_detector data_shape, mean_pixels, ctx=ctx)

File "/home/wyc/mxnet/example/ssd/detect/detector.py", line 37, in init self.mod.bind(data_shapes=[('data', (batch_size, 3, data_shape, data_shape))])

File "/home/wyc/mxnet/python/mxnet/module/module.py", line 388, in bind state_names=self._state_names)

File "/home/wyc/mxnet/python/mxnet/module/executor_group.py", line 205, in init
self.bind_exec(data_shapes, label_shapes, shared_group)

File "/home/wyc/mxnet/python/mxnet/module/executor_group.py", line 301, in bind_exec
shared_group))

File "/home/wyc/mxnet/python/mxnet/module/executor_group.py", line 593, in _bind_ith_exec
arg_arr = nd.zeros(arg_shapes[j], context, dtype=arg_types[j])

File "/home/wyc/mxnet/python/mxnet/ndarray.py", line 900, in zeros
return _internal._zeros(shape=shape, ctx=ctx, dtype=dtype)

File "/home/wyc/mxnet/python/mxnet/_ctypes/ndarray.py", line 133, in generic_ndarray_function
c_array(ctypes.c_char_p, [c_str(str(i)) for i in kwargs.values()])))

File "/home/wyc/mxnet/python/mxnet/base.py", line 78, in check_call
raise MXNetError(py_str(_LIB.MXGetLastError()))

mxnet.base.MXNetError: [11:04:01] src/c_api/c_api_ndarray.cc:381: Operator _zeros cannot be run; requires at least one of FCompute<xpu>, NDArrayFunction, FCreateOperator be registered`

How could i do to deal with it?
Thank you!

@zhreshold
Copy link
Member

@wengyc python demo.py --cpu

@wengyc
Copy link

wengyc commented Mar 29, 2017

@zhreshold I downloaded the newest mxnet and make it.Now it works on gpu.Thank you!

@BenLag2906
Copy link

Hi,
I have the same problem.

"
C:\SSD\mxnet-ssd.cpp\build\vc14\Release>ssd person.jpg --gpu=-1 -m ./deploy_ssd_300
[09:26:57] C:\MXNET\mxnet\mxnet\dmlc-core\include\dmlc/logging.h:304: [09:26:57] C:\MXNET\mxnet\mxnet\nnvm\src\core\op.cc:55: Check failed: op != nullptr Operator Scale is not registered
"
where can I found the correct model ? drop box is not available anymore.

Thanks for your advises.

Ben

@lxtGH
Copy link

lxtGH commented Feb 7, 2018

try to compile mxnet with CUDNN=1

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

No branches or pull requests

8 participants