To whom it may concern:
I am trying to use EfficientNet, but it relies heavily on swish activation functions.
Swish activation functions do not seem to be supported by snpe.
How could I use swish activation functions with snpe? Would I need to define them as User Defined Operations? And if so, can you share some sample code achieving this purpose?
Thank you in advance.
Kind regards.
Hi 22imonreal,
You can try following approach in order to get the EfficientNet model compiled on SNPE,
1. Installing EfficientNet package of python in order to load EfficientNet Keras model.
Reference : https://pypi.org/project/efficientnet/
2. Load Keras backend, set the learning phase of Keras backend to 0 before loading the model.
3. Load the Model of EfficientNet
4. As given above, the model object will be a Keras Model,
5. Get the tensorflow session from Keras backend and load the graph.
6. After loading the graph save the EfficientNet Model as FrozenGraph.
7. After that use the snpe-tensorflow-to-dlc tool to convert the model in DLC format.
NOTE: While following above steps, make sure that you are using Tensorflow >=1.13.2 & <=1.15.0
Hope this will resolve your issue.
Regards,
Sahil Bandar