-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Trying to export a segment model -- "IndexError: index 1 is out of bounds for dimension 0 with size 1" #472
Comments
Yes i encountered the same error with a trained segmentation model ;( |
It seems to have something to do with the preperation of the dual models outputs when in eval mode. Logically i tried to change the line to return (torch.cat([d[0], mc[1]], 1), (d[1], mc[1], p[1])), then the export works. But when using the onnx for inference, it does not produce 2 output tensors as expected but 4 and they are malformed. For now im falling back onto the gelan models that do work, including the export to onnx. :/ maybe someone smarter than me knows how to concat the resulting tensors correctly. |
failed to export weight trained using train_dual too, any update on this? |
same error! |
Shouldn't it be |
I'm trying to convert yolov9-c-seg.pt to ONNX, using
export.py
, but I get the following error. Has anyone else hit this?One note is that I had to make a change to get
segment/predict.py
running. Afterpred, proto = model(im, augment=augment, visualize=visualize)[:2]
I addedproto = proto[2]
based on another issue I found here. Not sure it's relevant to my current error, but possibly.The text was updated successfully, but these errors were encountered: