Skip to main content

sp




Sinapsis Framework Converter

Templates for conversion between deep learning frameworks.

🐍 Installation • 🚀 Features 📙 Documentation • 🔍 License

The sinapsis-framework-converter module allows for the conversion between some of the most popular deep learning frameworks in the community:

  • Keras -> Tensorflow
  • Tensorflow -> ONNX
  • Pytorch -> TensorRT
  • Pytorch -> ONNX
  • ONNX -> TensorRT

🐍 Installation

[!NOTE] CUDA-based templates in Sinapsis-framework-converter require NVIDIA driver version to be 550 or higher.

Install using your package manager of choice. We encourage the use of uv

Example with uv:

uv pip install sinapsis-framework-converter --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

pip install sinapsis-framework-converter --extra-index-url https://pypi.sinapsis.tech

[!IMPORTANT] Templates in each package may require extra dependencies. For development, we recommend installing the package with all the optional dependencies:

Example with uv:

uv pip install sinapsis-framework-converter[all] --extra-index-url https://pypi.sinapsis.tech

or with raw pip:

pip install sinapsis-framework-converter[all] --extra-index-url https://pypi.sinapsis.tech

[!IMPORTANT] To enable tensorflow with cuda support please install tensorflow as follows:

uv pip install tensorflow[and-cuda]==2.18.0

or

pip install tensorflow[and-cuda]==2.18.0

🚀 Features

Templates Supported

The Sinapsis Framework Converter module provides multiple templates for deep learning framework conversion.

  • KerasTensorFlowConverter: Converts Keras models to TensorFlow.
  • ONNXTRTConverter: Converts ONNX models to TensorRT.
  • TensorFlowONNXConverter: Converts TensorFlow models to ONNX.
  • TorchONNXConverter: Converts PyTorch models to ONNX.
  • TorchTRTConverter: Converts PyTorch models to TensorRT.
▶️ Example Usage

The following example demonstrates how to use the TorchONNXConverter template to convert a PyTorch model into the ONNX format. The configuration sets up an agent with the necessary templates to load a model, convert it, and store the converted file. Below is the full YAML configuration, followed by a breakdown of each component.

agent:
  name: conversion_agent

templates:
- template_name: InputTemplate
  class_name: InputTemplate
  attributes: {}

- template_name: TorchONNXConverter
  class_name: TorchONNXConverter
  template_input: InputTemplate
  attributes:
    model_name: resnet50
    save_model_path: true
    force_compilation: true
    opset_version: 12
    height: 224
    width: 224

This configuration defines an agent and a sequence of templates to perform model conversion.

  1. Input Handling (InputTemplate): This serves as the initial template.
  2. Model Conversion (TorchONNXConverter): Loads a PyTorch model (e.g., resnet50) and converts it to ONNX format. The template:
    • Uses the model_name attribute to specify which PyTorch model to convert.
    • Applies the opset_version attribute to define the ONNX operator set version (e.g., 12).
    • Adjusts the input tensor dimensions using height and width.
    • Enables force_compilation to ensure the model is recompiled if needed.
  3. Saving the Converted Model: The save_model_path attribute is set to true, ensuring that the output ONNX model path is saved in the DataContainer.

📙 Documentation

Documentation is available on the sinapsis website

Tutorials for different projects within sinapsis are available at sinapsis tutorials page

🔍 License

This project is licensed under the AGPLv3 license, which encourages open collaboration and sharing. For more details, please refer to the LICENSE file.

For commercial use, please refer to our official Sinapsis website for information on obtaining a commercial license.

Metadata

Release files for sinapsis-framework-converter 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sinapsis-framework-converter 0.1.11
File Size Uploaded
sinapsis_framework_converter-0.1.11.tar.gz 29.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sinapsis-framework-converter 0.1.11
File Interpreter ABI Platform
sinapsis_framework_converter-0.1.11-py3-none-any.whl Python 3 none any Details

Total release size: 64.2 kB

Release files / sinapsis_framework_converter-0.1.11.tar.gz

Download URL sinapsis_framework_converter-0.1.11.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
65bfbd5a24530b1139ea6d571d0683c9d424d4302b1a195423ce769e6a340e2e
BLAKE2b-256 checksum
How to use checksums
cf976f100e563893903efb39386e48bb1a71dbee5960ddb242f1daf9157af108
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release files / sinapsis_framework_converter-0.1.11-py3-none-any.whl

Download URL sinapsis_framework_converter-0.1.11-py3-none-any.whl
Size 35.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
933fbebcd5837d93a4efb59254592605a49db25b5a9f229345a9f5c28f7a1cba
BLAKE2b-256 checksum
How to use checksums
07f8d27b1ea4ad6074381d7b6f0379bb245107292e6fd12238e9adf2683d2093
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.16

Release history Release notifications | RSS feed

This release

0.1.11 This release

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page