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

Unable to load onnx models into Triton #53

Open
amirhmk opened this issue Apr 13, 2023 · 7 comments
Open

Unable to load onnx models into Triton #53

amirhmk opened this issue Apr 13, 2023 · 7 comments

Comments

@amirhmk
Copy link
Contributor

amirhmk commented Apr 13, 2023

Hi there,

I have been working on deploying our inference pipeline on clearml-serving using the docker-compose approach. I've hashed out most of the issues thus far thanks to the community, now I am facing another issue while loading onnx models.

I am getting the following error:

clearml-serving-triton   | mmdet  | UNAVAILABLE: Internal: **failed to stat file /models/mmdet/1/model.onnx**

I exec'd into the container to see what's inside /models, and under /models/mmdet/1 there was a model.bin but no model.onnx. I created the modeling using the OutputModel. I also tried doing it through the CLI:

clearml-serving --id $SERVING_ID model upload --name "mmdet_cli" --project $PROJECT_NAME --path /mmdet/model.onnx

but the same thing. I'm guessing when the folder structure is getting set up, this file gets renamed to a .bin extention. Should this be happening or am I doing something wrong?

When I download the file from the models section in the portal, it's an onnx file, exactly the one I uploaded. So not sure where this renaming is happening tbh...
Screenshot 2023-04-13 at 3 12 25 PM

@thepycoder
Copy link
Contributor

thepycoder commented Apr 13, 2023

Hi @amirhmk!

The model extentions are hardcoded based on the framework type of the model in ClearML.
You have 2 options:

  • Override the default filename as in the example here, you'll see the config override in the CLI commands
  • Or you can manually specify the model framework when you upload it, set framework argument to 'onnx' and it should properly rename it!

EDIT: I just saw that your framework in clearml is properly set. That's weird and probably a bug on our end. Please check if the first fix works for you, we'll investigate the second :)

Hope this helps! :)

@amirhmk
Copy link
Contributor Author

amirhmk commented Apr 13, 2023

Hi @thepycoder, option 1 worked, thanks! Adding default_model_filename: "model.bin" to config.pbtxt and passing it as a file was fine. Though regarding your second point, did onnx models use to have the .bin extention that this is setup like this?

Also as a small aside, I found out that if one passes a file (path) for --aux-config, it'll completely copy paste the passed in config file, and still add the input/output shapes/types/names to the bottom of the final config file - resulting in errors. I thought it would make sense to only pass the config file, and not have to even pass all the shapes one-by-one in the command. Wdyt?

@thepycoder
Copy link
Contributor

option 1 worked, thanks!

Excellent!

Though regarding your second point, did onnx models use to have the .bin extention that this is setup like this?

Possibly yes, this might be a remnant of earlier ONNX days, I'll have to check.

I thought it would make sense to only pass the config file, and not have to even pass all the shapes one-by-one in the command. Wdyt?

Yeah, I think that makes sense, I'll discuss it with the devs :) Thanks a lot for the suggestion!

@ainoam
Copy link

ainoam commented May 15, 2023

I thought it would make sense to only pass the config file, and not have to even pass all the shapes one-by-one in the command. Wdyt?

@amirhmk Aren't these already optional CLI parameters? i.e. you don't have to specify them if their already specified in the config file.

@amirhmk
Copy link
Contributor Author

amirhmk commented Jul 6, 2023

@ainoam so most of those are, but the input(or output) shapes/types are mandatory.

@ainoam
Copy link

ainoam commented Jul 9, 2023

@amirhmk Can you give an example of your CLI invocation, and mark which parameters seem to be unnecessarily mandatory (i.e. also specified in your aux file)

@IlyaMescheryakov1402
Copy link

@ainoam #62

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants