Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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' #475

Open
PapaMadeleine2022 opened this issue Oct 29, 2018 · 6 comments

Comments

@PapaMadeleine2022
Copy link

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?

@rainLiuplus
Copy link
Contributor

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!

@JingzheLyp
Copy link

hi, @IvyGongoogle, I have met the same problem, and i've tried @rainLiuplus' method, but doesn't use at all, do you resolve it?

@asa008
Copy link

asa008 commented May 7, 2019

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

@arya-none
Copy link

Hi @asa008
I have met the same problem,when convert tensorflow to pytorch, do you resolve it?
Thank you

@machanic
Copy link

@arya-none @asa008 Do you solve this problem? I encounter the same issue!

@machanic
Copy link

I posted an issue here: #925

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

No branches or pull requests

6 participants