Skip to main content

DeepViewRT Converter

Project description

DeepView Converter

deepview-converter is the model compiler for the DeepViewRT inference engine. It takes a trained model from a common training framework and produces a .rtm model — the native format DeepViewRT loads to run inference on the edge.

The converter imports the source model, runs a graph optimization pass, and exports an RTM model with an embedded memory map so the runtime can execute it with a fixed, pre-planned allocation.

Supported inputs

Format Extension / layout Notes
TFLite .tflite Must already be quantized to convert quantized
ONNX .onnx
TensorFlow .pb, SavedModel, Keras .h5 Can be quantized at convert time (--quantize)

The output is always a DeepViewRT .rtm model.

Installation

pip install deepview-converter

This pulls in the matching deepview-rt runtime as a dependency.

Usage

The package installs the rtm-converter console script (equivalently python -m deepview_rtm):

# Basic conversion
rtm-converter model.onnx model.rtm

# Quantize a float TensorFlow/Keras model using calibration samples
rtm-converter model.h5 model.rtm --quantize --samples ./calibration_images

# Constrain the converted graph to a subgraph by I/O layer names
rtm-converter model.tflite model.rtm \
    --input-names input_0 --output-names logits

Run rtm-converter --help for the full set of options, including quantization mode (--quant-channel / --quant-tensor), input/output data types, custom user-op handlers, and optimizer controls (--skip-optimizations).

Set DEEPVIEW_CONVERTER_DEBUG=1 to print a full traceback when a conversion fails.

Testing

pip install pytest pytest-html
python -m pytest --html=tests/report.html -s --capture=tee-sys --self-contained-html

The HTML report is written to tests/report.html.

Changelog

See CHANGELOG.md for release notes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepview_converter-3.0.3-py3-none-any.whl (202.9 kB view details)

Uploaded Python 3

File details

Details for the file deepview_converter-3.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for deepview_converter-3.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4387befad809db8db7fbe5ed0d9b4f9b2e23d8b234939e39d56ec721e20be58f
MD5 2e4b57a862f01bf1751a285ecfe2c0cb
BLAKE2b-256 81d8bd5f7d2b62c5de04998b0f8dd51f79f5f84247897ec8576303fa1eacd242

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page