MMdnn is a set of tools to help users inter-operate among different deep learning frameworks. E.g. model conversion and visualization. Convert models between Caffe, Keras, MXNet, Tensorflow, CNTK, PyTorch Onnx and CoreML.
MIT License
5.8k
stars
965
forks
source link
weight_data get None during convert MXnet model to TF #616
Traceback (most recent call last):
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 197, in <module>
_main()
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 192, in _main
ret = _convert(args)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 81, in _convert
from mmdnn.conversion.mxnet.mxnet_parser import MXNetParser
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 538
self.set_weight(source_node.name, "bias", self.weight_data.get(source_node.name + "_beta").asnumpy())
^
SyntaxError: invalid syntax
D:\svnML\ditSRC\modules\AIOT\div_algo\model\face\insightface\gamodel-r50>python -m mmdnn.conversion._script.convertToIR -f mxnet -n model-symbol.json -w model-0000.params -d model-r50 --inputShape 3,112,112
[10:23:54] C:\Jenkins\workspace\mxnet-tag\mxnet\src\nnvm\legacy_json_util.cc:209: Loading symbol saved by previous version v1.2.0. Attempting to upgrade...
[10:23:54] C:\Jenkins\workspace\mxnet-tag\mxnet\src\nnvm\legacy_json_util.cc:217: Symbol successfully upgraded!
C:\Users\hsiaoyuh_wang\AppData\Roaming\Python\Python36\site-packages\mxnet\module\base_module.py:56: 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)
Warning: MXNet Parser has not supported operator null with name data.
Warning: convert the null operator with name [data] into input layer.
Traceback (most recent call last):
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 197, in <module>
_main()
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 192, in _main
ret = _convert(args)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\_script\convertToIR.py", line 115, in _convert
parser.run(args.dstPath)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\common\DataStructure\parser.py", line 22, in run
self.gen_IR()
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 262, in gen_IR
func(current_node)
File "C:\Users\hsiaoyuh_wang\AppData\Local\Programs\Python\Python36\lib\site-packages\mmdnn\conversion\mxnet\mxnet_parser.py", line 538, in rename_BatchNorm
self.set_weight(source_node.name, "bias", self.weight_data.get(source_node.name + "_beta").asnumpy())
AttributeError: 'NoneType' object has no attribute 'asnumpy'
I think this issue caused by the BatchNorm op "name": "gender_resnet0_batchnorm0_fwd" don't have the beta, so "self.weight_data.get(source_node.name + "_beta")" get None.
Hi
I have a similar problem of #231
I used the model: https://www.dropbox.com/s/2xq8mcao6z14e3u/gamodel-r50.zip?dl=0
python -m mmdnn.conversion._script.convertToIR -f mxnet -n model-symbol.json -w model-0000.params -d model-r50 --inputShape 3,112,112
I think this issue caused by the BatchNorm op "name": "gender_resnet0_batchnorm0_fwd" don't have the beta, so "self.weight_data.get(source_node.name + "_beta")" get None.
Do you have any suggestion?