MMdnn icon indicating copy to clipboard operation
MMdnn copied to clipboard

Convert mxnet model to IR, name not found in symbol.list_arguments()

Open ningningG opened this issue 7 years ago • 7 comments

Platform (like ubuntu 16.04/win10): win10

Python version: 3.6.6

Source framework with version (like Tensorflow 1.4.1 with GPU): mxnet 1.3.0

Destination framework with version (like CNTK 2.3 with GPU): tensorflow 1.10.0 with GPU

Running scripts: mmtoir -f mxnet -n sag_cor-symbol.json -w sag_cor-0500.params -d sag_cor_line --inputShape 1,256,256

When converting there are folowing warnings and errors

[13:59:19] C:\Jenkins\workspace\mxnet-tag\mxnet\src\nnvm\legacy_json_util.cc:209: Loading symbol saved by previous version v1.1.0. Attempting to upgrade...
[13:59:19] C:\Jenkins\workspace\mxnet-tag\mxnet\src\nnvm\legacy_json_util.cc:217: Symbol successfully upgraded!
e:\app_tools\envs\mx\lib\site-packages\mxnet\module\base_module.py:55: UserWarning: [91mYou created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
        data
        label[0m
  warnings.warn(msg)
Warning: MXNet Parser has not supported operator null with name data.
Warning: convert the null operator with name [data] into input layer.
Warning: MXNet Parser has not supported operator null with name label.
Traceback (most recent call last):
  File "e:\app_tools\envs\mx\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\app_tools\envs\mx\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\app_tools\envs\mx\Scripts\mmtoir.exe\__main__.py", line 9, in <module>
  File "e:\app_tools\envs\mx\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 192, in _main
    ret = _convert(args)
  File "e:\app_tools\envs\mx\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 115, in _convert
    parser.run(args.dstPath)
  File "e:\app_tools\envs\mx\lib\site-packages\mmdnn\conversion\common\DataStructure\parser.py", line 22, in run
    self.gen_IR()
  File "e:\app_tools\envs\mx\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 268, in gen_IR
    self.rename_UNKNOWN(current_node)
  File "e:\app_tools\envs\mx\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 391, in rename_UNKNOWN
    raise NotImplementedError()
NotImplementedError

When add 'print('current_node.name : ', current_node.name)' in gen_IR in mxnet_parser.py before 'if hasattr(self, "rename_" + node_type):', only 'current_node.name : data' and 'current_node.name : label' is printed, can't parse other layers, why? Please help me

ningningG avatar Oct 08 '18 06:10 ningningG

Hi @ningningG , could you provide your model file for us to debug?

namizzz avatar Oct 08 '18 11:10 namizzz

Thanks for your reply @namizzz , this is a UNet model I trained, not a pred_trained model download from the Internet. model path : https://drive.google.com/open?id=1f792k3-jmxzrxlQlCF9AXeOvv6065Tqa

ningningG avatar Oct 09 '18 06:10 ningningG

@namizzz Do you have any update since then?

I have a model without lost layer, which is purely for inference, also have the same kind of issue.

> mmtoir -f mxnet -n scale2.0x_model-symbol.json -w scale2.0x_model-0000.params -d scale2x -inode data -node conv7_layer
c:\program files\python37\lib\site-packages\mxnet\module\base_module.py:55: UserWarning: [91mYou created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
        data[0m
  warnings.warn(msg)
Traceback (most recent call last):
  File "c:\program files\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\program files\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Program Files\Python37\Scripts\mmtoir.exe\__main__.py", line 9, in <module>
  File "c:\program files\python37\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 192, in _main
    ret = _convert(args)
  File "c:\program files\python37\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 80, in _convert
    parser = MXNetParser(model)
  File "c:\program files\python37\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 242, in __init__
    assert isinstance(input_arg[3], list)
AssertionError

I dont it is nessnary to include the lost layer in the model for conversion.

Model link: https://github.com/WolframRhodium/Super-Resolution-Zoo/tree/master/waifu2x/waifu2x-caffe%40lltcggie

kice avatar Mar 04 '19 20:03 kice

@kice I have the same problem with you. Have you solved it? d:\anaconda3\lib\site-packages\mxnet\module\base_module.py:54: UserWarning: [91mYou created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of: data prob_label[0m warnings.warn(msg) Traceback (most recent call last): File "d:\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "d:\anaconda3\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\Anaconda3\Scripts\mmconvert.exe\__main__.py", line 9, in <module> File "d:\anaconda3\lib\site-packages\mmdnn\conversion\_script\convert.py", line 102, in _main ret = convertToIR._convert(ir_args) File "d:\anaconda3\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 80, in _convert parser = MXNetParser(model) File "d:\anaconda3\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 242, in __init__ assert isinstance(input_arg[3], list) AssertionError

WSCZou avatar Mar 25 '19 07:03 WSCZou

@kice @WSCZou I have the same error as you both, did you have any progress?

$ mmconvert -sf mxnet -iw Code/model-y1-test2/model-0000.params -in Code/model-y1-test2/model-symbol.json -df tensorflow -om Code/
[12:02:52] src/nnvm/legacy_json_util.cc:209: Loading symbol saved by previous version v1.0.0. Attempting to upgrade...
[12:02:52] src/nnvm/legacy_json_util.cc:217: Symbol successfully upgraded!
/anaconda3/lib/python3.6/site-packages/mxnet/module/base_module.py:55: UserWarning: You created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of:
        data
  warnings.warn(msg)
Traceback (most recent call last):
  File "/anaconda3/bin/mmconvert", line 10, in <module>
    sys.exit(_main())
  File "/anaconda3/lib/python3.6/site-packages/mmdnn/conversion/_script/convert.py", line 102, in _main
    ret = convertToIR._convert(ir_args)
  File "/anaconda3/lib/python3.6/site-packages/mmdnn/conversion/_script/convertToIR.py", line 80, in _convert
    parser = MXNetParser(model)
  File "/anaconda3/lib/python3.6/site-packages/mmdnn/conversion/mxnet/mxnet_parser.py", line 242, in __init__
    assert isinstance(input_arg[3], list)
AssertionError

not-william avatar Oct 16 '19 03:10 not-william

@kice @WSCZou @not-william Save the baby!!!I have the same error, did you have any progress?

mmconvert -sf mxnet -in model-symbol.json -iw model-0001.params -df pytorch -om insightface.pth d:\programdata\anaconda3\lib\site-packages\mxnet\module\base_module.py:55: UserWarning: [91mYou created Module with Module(..., label_names=['softmax_label']) but input with name 'softmax_label' is not found in symbol.list_arguments(). Did you mean one of: data[0m warnings.warn(msg) Traceback (most recent call last): File "d:\programdata\anaconda3\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "d:\programdata\anaconda3\lib\runpy.py", line 85, in run_code exec(code, run_globals) File "d:\ProgramData\Anaconda3\Scripts\mmconvert.exe_main.py", line 9, in File "d:\programdata\anaconda3\lib\site-packages\mmdnn\conversion_script\convert.py", line 102, in _main ret = convertToIR._convert(ir_args) File "d:\programdata\anaconda3\lib\site-packages\mmdnn\conversion_script\convertToIR.py", line 80, in _convert parser = MXNetParser(model) File "d:\programdata\anaconda3\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 242, in init assert isinstance(input_arg[3], list) AssertionError

hereandnowhan avatar Oct 25 '19 07:10 hereandnowhan

@kice @WSCZou @not-william @hereandnowhan Not having the label name isn't an issue for the conversion. But for the assertion error, it's because you forgot to add the --inputShape argument for example, if your input shape is (batch, channels, h, w), you need to add : --inputShape channels,h,w to your command line

dylan-brasseur avatar Jun 07 '20 01:06 dylan-brasseur