Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

AttributeError: 'list' object has no attribute 'name' #602

Open
juliansjungwirth opened this issue Aug 28, 2020 · 1 comment
Open

AttributeError: 'list' object has no attribute 'name' #602

juliansjungwirth opened this issue Aug 28, 2020 · 1 comment

Comments

@juliansjungwirth
Copy link

juliansjungwirth commented Aug 28, 2020

Converting a tf-keras 2.2.0/2.3.0 model with multiple output tensors to onnx, I faced the following error:

... in extract_outputs_from_inbound_nodes
    op_name = tsname_to_node(ts_.name)
AttributeError: 'list' object has no attribute 'name'

A potential solution that worked for me is:

# enable the following lines from _parser_tf.py to be compatible with list-outputs:
for ts_ in output_tensors:
    op_name = tsname_to_node(ts_.name)
    if op_name not in output_dict:
        output_dict[op_name] = (model, None)         

--->

 for ts_ in output_tensors:
    if not isinstance(ts_, (tuple, list)):
        ts_ = [ts_]
    for ts__ in ts_:
        op_name = tsname_to_node(ts__.name)
        if op_name not in output_dict:
            output_dict[op_name] = (model, None)

Maybe, in a future version, it is possible to pay respect to these kinds of outputs. Thanks and kind regards :)

@wenbingl
Copy link
Member

@julianjungwirth , would you please propose your fixing as a PR to help other as well?

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

2 participants