packages/mmdnn/conversion/tensorflow/tensorflow_parser.py", line 660, in rename_FusedBatchNorm self.set_weight(source_node.name, 'mean', self.ckpt_data[mean.name]) AttributeError: 'NoneType' object has no attribute 'name'
hello, when I run
mmconvert -sf tensorflow -in my_model.ckpt.meta -iw my_model.ckpt --dstNodeName xxx -df caffe -om tf_model
it shows error:
File "/xxx/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/_script/convert.py", line 102, in _main
ret = convertToIR._convert(ir_args)
File "/xxx/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/_script/convertToIR.py", line 115, in _convert
parser.run(args.dstPath)
File "/xxx/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/common/DataStructure/parser.py", line 22, in run
self.gen_IR()
File "/xxx/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_parser.py", line 309, in gen_IR
func(current_node)
File "/xxx/anaconda2/lib/python2.7/site-packages/mmdnn/conversion/tensorflow/tensorflow_parser.py", line 660, in rename_FusedBatchNorm
self.set_weight(source_node.name, 'mean', self.ckpt_data[mean.name])
AttributeError: 'NoneType' object has no attribute 'name'
in my model, I use slim.batch_norm. so this slim.batch_norm causes the error?
how should I fix it?
Hi @IvyGongoogle , probably the 'mean' node is not at the position self.get_parent(source_node.name, [3, 0], True). Please add if mean is None: mean = self.get_parent(source_node.name, [3]) after https://github.com/Microsoft/MMdnn/blob/master/mmdnn/conversion/tensorflow/tensorflow_parser.py#L709 to have a try. Thanks!
hi, @IvyGongoogle, I have met the same problem, and i've tried @rainLiuplus' method, but doesn't use at all, do you resolve it?
Hi, @IvyGongoogle , @rainLiuplus , @JingzheLyp I have met the same problem, it seems that code length has changed, where should I add the code 'if mean is None: mean = self.get_parent(source_node.name, [3])' ? Thank you
Hi @asa008 I have met the same problem,when convert tensorflow to pytorch, do you resolve it? Thank you
@arya-none @asa008 Do you solve this problem? I encounter the same issue!
I posted an issue here: https://github.com/microsoft/MMdnn/issues/925