PolimiDL Converter is a Deep Learning model converter to support the use of PolimiDL inference framework.
It takes in input a model trained with the Deep Learning framework of your choice and generates as output a model with PolimiDL's compatible format for its deployment.
The current supported Deep Learning frameworks in PolimiDL Converter are:
- TensorFlow
To install the required modules:
# Install tensorflow
pip install tensorflow
# Install abc for abstract methods definition
pip install abcplus
To convert a model trained on TensorFlow:
python main.py --model_path MODEL_PATH --model_name MODEL_NAME --output_path OUTPUT_PATH
To convert MobileNet model trained on TensorFlow:
python main.py --model_path models/mobilenet_v1_1.0_224_frozen.pb --model_name mobilenet
PolimiDL Converter presents a generic and easily extensible architecture. To support the conversion of models trained with additional frameworks, you should extend the abstract classes and corresponding abstract methods defined in the following modules:
converter/converter.py
converter/layer.py
You can look at the implementation for TensorFlow support:
converter/converter_tensorflow.py
converter/layer_tensorflow.py
The extension of supported layers is coupled to the support of such layers in PolimiDL.
If a new layer is introduced into PolimiDL, then you can support such layer by defining its generic implementation in converter/layer.py
and its custom framework implementation in the corresponding module extension (e.g. converter/layer_tensorflow.py
).