A command line tool for parsing and displaying RKNN model information with FlatBuffers support.
- Parse both FlatBuffers binary data and JSON metadata from RKNN files
- Extract detailed model information including format, compiler, runtime
- Display input/output tensor information with layout (NCHW) and data type
- Visualize FlatBuffers graph with Graphviz (SVG output)
- Python 3.8+ compatible
pip install rknncligit clone https://github.com/your-username/rknncli.git
cd rknncli
pip install -e .rknncli <path-to-rknn-model>Example:
rknncli assets/base-encoder.rknnGraph visualization:
rknncli assets/base-encoder.rknn --draw base-encoder.svgNote: Graph visualization requires Graphviz installed and dot available in PATH.
The tool prints comprehensive model information including FlatBuffers metadata:
Model: rknn model
Target Platform: rk3588
Format: RKNPU v2
Source: ONNX
Compiler: 2.1.0+708089d1(compiler version: 2.1.0)
Runtime: rk3588
Number of graphs: 1
Input information
--------------------------------------------------------------------------------
ValueInfo "base-mel": type FLOAT32, shape [1, 80, 3000], layout NCHW,
Output information
--------------------------------------------------------------------------------
ValueInfo "cross_k_0": type FLOAT16, shape [1, 1500, 512], layout NCHW,
ValueInfo "cross_v_0": type FLOAT16, shape [1, 1500, 512], layout NCHW,
- Python 3.8+
- FlatBuffers compiler (for schema updates)
# Clone the repository
git clone https://github.com/hebangwen/rknncli.git
cd rknncli
# Install in development mode
pip install -e .
# Run tests
rknncli assets/base-encoder.rknnIf you need to update the RKNN schema:
cd schemas
./generate_schema.shTo publish a new version:
# Build the package
python -m build
# Upload to PyPI
./scripts/upload_to_pypi.shSee CHANGELOG.md for version history.
MIT License - see LICENSE file for details.