docs.rs failed to build onnx-extractor-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
onnx-extractor
A tiny, lightweight ONNX model parser for extracting tensor shapes, operations, and raw data.
Quick start
use OnnxModel;
let model = load_from_file?;
model.print_summary;
About the protobuf (onnx.proto
)
This crate generates Rust types from the ONNX protobuf at build time using prost-build
.
build.rs
will downloadonnx.proto
from the ONNX repo if the file is missing.prost-build
compiles the.proto
intoonnx.rs
under$OUT_DIR
and the crate includes it with:include!(concat!(env!("OUT_DIR"), "/onnx.rs"));
Notes:
- The build step requires
curl
(only ifonnx.proto
isn't present) and network access. prost_build::Config::bytes(["."])
configuresbytes
fields asprost::bytes::Bytes
; the code converts these toVec<u8>
orString
where needed.
Troubleshooting
- If the build fails because
curl
is missing, either installcurl
or placeonnx.proto
at the repository root to avoid the download step. - If you prefer to avoid code generation at build time, you can vendor the generated
onnx.rs
intosrc/
and changeinclude!
accordingly.
License
MIT