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

Attribute new_axis_mask not supported #1814

Closed
rtm-1dyakonov opened this issue Dec 29, 2021 · 5 comments
Closed

Attribute new_axis_mask not supported #1814

rtm-1dyakonov opened this issue Dec 29, 2021 · 5 comments
Assignees
Labels
pending on user response Waiting for more information or validation from user

Comments

@rtm-1dyakonov
Copy link

I am trying to convert model created from TensorFlow Object Detection API from saved_model.pb to Onnx format.

Unfortunately, next issue arrises:
ValueError: StridedSlice: attribute new_axis_mask not supported

Here you can find my model either in saved_model and checkpoint formats.

@hwangdeyu
Copy link
Contributor

Could you also provide a simple repro script python code?
This issue is related to this line tensor.py#L785 StridedSlice.

@paulfauthmayer
Copy link

We were encountering the same issue when we tried to convert a model for which we wrote a custom layer. We were at first a bit confused because we nowhere explicitly used a StridedSlice but figured it was somewhere in the implementation of one of the functions we used.

What fixed the issue for us, oddly enough, was to explicitly specify the newest opset. i.e.:

    model = tf.keras.models.load_model(model_path)
    tf2onnx.convert.from_keras(model, output_path="model.onnx")

threw the same error @rtm-1dyakonov encountered above, but

    model = tf.keras.models.load_model(model_path)
    tf2onnx.convert.from_keras(model, output_path="model.onnx", opset=15)

did not. I guess there may be something wrong with the default opset? Hope that helps :)

@fatcat-z
Copy link
Collaborator

Starting from opset 10, tf2onnx changed the way to handle StridedSlice op and accepted "new_axis_mask" attribute. So your solution is expected.

@fatcat-z fatcat-z added pending on user response Waiting for more information or validation from user and removed need-info labels Mar 19, 2022
@fatcat-z fatcat-z self-assigned this Mar 19, 2022
@Regenhardt
Copy link

Just newly installed tf2onnx and ran into this issue using default values. Should the default opset be set higher to avoid these problems? I'd say ML is a fast enough moving field currently that newer features should be preferred to compatibility for now.

@fatcat-z
Copy link
Collaborator

Just newly installed tf2onnx and ran into this issue using default values. Should the default opset be set higher to avoid these problems? I'd say ML is a fast enough moving field currently that newer features should be preferred to compatibility for now.

Yes, there is another PR changing the default opset to 13. Please look forward to next release. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending on user response Waiting for more information or validation from user
Projects
None yet
Development

No branches or pull requests

5 participants