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

Util to expose intermediate tensors as outputs #2254

Open
smpanaro opened this issue Jun 24, 2024 · 2 comments
Open

Util to expose intermediate tensors as outputs #2254

smpanaro opened this issue Jun 24, 2024 · 2 comments
Labels
feature request Functionality does not currently exist, would need to be created as a new feature (type)

Comments

@smpanaro
Copy link
Contributor

🌱 Describe your Feature Request

Sometimes when debugging a CoreML model it can be difficult to know where exactly inside of the model it is failing. I wrote a script for myself to expose intermediate tensors as model outputs without having to reconvert the model. It saved me a bunch of time, so was curious if it's the sort of thing that would be useful in the utils package.

How can this feature be used?

Any time your model outputs look wrong, you can trace through and compare with a source (e.g. PyTorch) model to see where they started to drift apart.

Describe alternatives you've considered

In the past I've manually de-composed my PyTorch model and re-converted each piece. It works but it's tedious.

Additional context

My script is here.

@smpanaro smpanaro added the feature request Functionality does not currently exist, would need to be created as a new feature (type) label Jun 24, 2024
@DawerG
Copy link
Collaborator

DawerG commented Jun 25, 2024

Thanks @smpanaro for this utility. Looks very useful.

Can you please create a PR to merge your script somewhere here in the debugging utils?

@smpanaro
Copy link
Contributor Author

smpanaro commented Jul 8, 2024

Thanks for the pointer! Looking a little closer, I think the extract_submodels util can actually handle this. I put up two small fixes to make it work for my model: #2267 and #2270

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Functionality does not currently exist, would need to be created as a new feature (type)
Projects
None yet
Development

No branches or pull requests

2 participants