Anyway to convert pb model that has NWHC input shape to mlmodel that has NCHW input shape?
- Dominant language
- Python
- Stars
- 5.4k
- Forks
- 850
- Avg merge
- 4d 5h
- Merged PRs (30d)
- 10
Description
## ❓Question
Anyway to convert pb model that has NWHC input/output shape to mlmodel that has NCHW input/output shape?
CoreML3.0 converter will automatically do such conversion,CoreML4.0 just keep the input shape and add a “transpose” which makes the mlmodel much slower than CoreML3.0 version (I guess the reason for the lower efficiency is the "transpose", nearly 3.0 times slower)!
Source:


CoreML3.0:


CoreML4.0:


## System Information
- iPhone XR iOS(14.3)
Contributor guide
Research direction
The issue names no repository file, test, or entry point. Start by reproducing conversion of the NWHC pb model with CoreML 3.0 and CoreML 4.0, then inspect the generated transpose and compare performance; done would require an agreed conversion approach that preserves the expected NCHW behavior without the reported slowdown.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100