Util to expose intermediate tensors as outputs
🌱 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.
Thanks @smpanaro for this utility. Looks very useful.
Can you please create a PR to merge your script somewhere here in the debugging utils?
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: https://github.com/apple/coremltools/pull/2267 and https://github.com/apple/coremltools/pull/2270
Closing this. Now that those other two PRs are merged, I think the existing util works for my use case.