-
Notifications
You must be signed in to change notification settings - Fork 65
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
Issue with pad layer, keyword 'constant' unexpected #29
Comments
Can you please provide the content of |
I ran into this issue and propose the following workaround: The content of the problematic node of op_type Pad is: The first two items get parsed correctly and correspond to the keywords of the Pad operator defined as: class Pad(Operator):
def __init__(self, mode="constant", padding=None): The problem lies with the third item of the node attributes (which name is value and is a 0 of type float. The attribute parser will add a constant entry to the keyword dict: elif attr.name == "value":
kwargs["constant"] = extract_attr_values(attr) Hence the error message : To fix this, we can do the following: onnx_model = onnx.load("my_model.onnx")
for i, node in enumerate(onnx_model.graph.node):
if node.op_type == 'Pad':
del node.attribute[2] # delete the problematic third item Note that you should print the node content to make sure which items generate the wrong behavior. |
got this error when trying to run ConvertModel using the process described in the readme, any idea what might be causing it?
The text was updated successfully, but these errors were encountered: