-
Notifications
You must be signed in to change notification settings - Fork 296
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
Converting Resize node fails with KeyWord="" Error #1053
Comments
There are significant changes in the combination of https://github.com/onnx/onnx/blob/main/docs/Changelog.md#resize-10 https://github.com/onnx/onnx/blob/main/docs/Changelog.md#resize-11 Also, unfortunately onnx-tensorflow appears to have almost stopped maintenance. Since you have not provided a link to the sample onnx file in question, I can't try it, but you can try to see if you can convert it without error with the tool I am creating. |
@PINTO0309, thanks for the answer This is the code # Load a model
model = YOLO("yolov8n.yaml") # build a new model from scratch
model = YOLO("yolov8n.pt") # load a pretrained model (recommended for training)
# Use the model
results = model.train(data="coco128.yaml", epochs=3) # train the model
results = model.val() # evaluate model performance on the validation set
results = model("https://ultralytics.com/images/bus.jpg") # predict on an image
success = model.export(format="onnx") # export the model |
The conversion has already been successful. |
@PINTO0309 With this repo or onnx2tf? |
onnx2tf |
@PINTO0309 Thanks!!!! I tried it too, and it works faster than before! |
I have already implemented all the optimization tricks that most engineers probably do not practice. You are probably already in a position to benefit from them. |
Describe the bug
In handlers/backend/resize.py, version_11 handler, the method checks for the roi tensor, but this (I think) will only exists when doing a "tf_crop_and_resize" operation, however when doing other normal resize this is not an input to the resize node and so the input to the node from the onnx graph is
""
an empty string.Converting to tf fails when converting the resize nodes and gives an wrong keyword error
Solution
The solution is to move the following lines
from the top of function version_11 to within the if condition
This leaves the rest of the code unchanged and fixes the bug
To Reproduce
ONNX model file
Python, ONNX, ONNX-TF, Tensorflow version
The text was updated successfully, but these errors were encountered: