I trained a model which accepts images, but is constructed in such a way that it is input width invariant.
This means I can build the model with any specified input width, and I can load the model weights (mainly convolution kernel weights) the same for any width. The number of parameters remains constant for any input width I specify.
When I compile it for the edgetpu however, changing the input width changes the optimization inside the edgetpu model.
When I specify a width of 800 it is very efficient (the model is only 464.94 Kb):
When I specify a width of 801 it is very inefficient (the model is suddenly 4.70 Mb):
When I specify a width of 802 it is very inefficient (the model is 4.71 Mb):
When I specify a width of 1600 it is very efficient again (the model is 1.58 Mb):
It probably has to do with internal optimizations of the compiler, but can someone explain what to look for and how to determine an optimal width before compiling?
I want to find an optimal width to use, but I do not want to compile a model for each and every input width up to 5000 pixels.
Click to expand!
### Issue Type
Support
### Operating System
Windows 10
### Coral Device
USB Accelerator
### Other Devices
_No response_
### Programming Language
Python 3.9
### Relevant Log Output
_No response_
Description
I trained a model which accepts images, but is constructed in such a way that it is input width invariant. This means I can build the model with any specified input width, and I can load the model weights (mainly convolution kernel weights) the same for any width. The number of parameters remains constant for any input width I specify.
When I compile it for the edgetpu however, changing the input width changes the optimization inside the edgetpu model. When I specify a width of 800 it is very efficient (the model is only 464.94 Kb):![image](https://github.com/google-coral/edgetpu/assets/126500866/739ebbde-660e-4275-820d-34e40da894c6)
When I specify a width of 801 it is very inefficient (the model is suddenly 4.70 Mb):![image](https://github.com/google-coral/edgetpu/assets/126500866/39b6fa51-3c71-490f-b149-cf2c49b710ca)
When I specify a width of 802 it is very inefficient (the model is 4.71 Mb):![image](https://github.com/google-coral/edgetpu/assets/126500866/a6af051d-4f8a-4232-a347-01820c680321)
When I specify a width of 1600 it is very efficient again (the model is 1.58 Mb):![image](https://github.com/google-coral/edgetpu/assets/126500866/0a0a57bc-3889-4aed-b3e8-f47e9e8b487a)
It probably has to do with internal optimizations of the compiler, but can someone explain what to look for and how to determine an optimal width before compiling? I want to find an optimal width to use, but I do not want to compile a model for each and every input width up to 5000 pixels.
Click to expand!
### Issue Type Support ### Operating System Windows 10 ### Coral Device USB Accelerator ### Other Devices _No response_ ### Programming Language Python 3.9 ### Relevant Log Output _No response_