Transformation FoldConstants() raises ONNXRuntimeError
See original GitHub issueUsing the transformation FoldConstants()
from module finn.transformation.fold_constants
raises an ONNXRuntimeError
. The following script is run in a brand new FINNv0.3 docker container:
import onnx
import brevitas.onnx as bo
from finn.util.test import get_test_model_trained
from finn.core.modelwrapper import ModelWrapper
from finn.transformation.infer_shapes import InferShapes
from finn.transformation.fold_constants import FoldConstants
tfc = get_test_model_trained("TFC", 1, 1)
bo.export_finn_onnx(tfc, (1, 1, 28, 28), "./tfc_w1_a1.onnx")
model = ModelWrapper("./tfc_w1_a1.onnx")
model = model.transform(InferShapes())
model = model.transform(FoldConstants())
It raises the following error:
...
[ONNXRuntimeError] : 2 : INVALID_ARGUMENT : Failed to load model with error: Unknown model file format version.
Full error message can be found here: https://pastebin.com/kG3rsYf1
As a consequence, all notebooks running this transformation cannot be run (tfc_end2end_example
, tfc_end2end_verification
and cnv_end2end_example
, 1_brevitas_network_import
).
Testing the same piece of code in the docker container with the FINNv0.2.1b release raises no error.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
The full trace follows - xilinx-finn/community - Gitter
When calling model.transform, however, I am encountering the following invalid argument error: InvalidArgument: [ONNXRuntimeError] : 2 : INVALID_ARGUMENT ...
Read more >trouble when use finn.transformation.fold_constants #583
1 model = model.transform(FoldConstants()) ... /workspace/finn-base/src/finn/transformation/fold_constants.py in apply(self, model) ... 121 raise Exception(
Read more >tf2onnx - Convert TensorFlow, Keras and Tflite models to ONNX.
The code that does the conversion is in tensorflow_to_onnx(). ... all throws error) then why that error not raised in standalone run?
Read more >Silero VAD - pre-trained enterprise-grade Voice Activity ...
Silero VAD Silero VAD - pre-trained enterprise-grade Voice Activity Detector (also see our STT models). This repository also includes Number ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Actually I just saw that our Jenkins CI was failing due to this problem today, so decided to fix this quickly. 4436914f0a212584cbc36a6bae2381374031ff4b is now in both
dev
andmaster
to address this. Can you confirm that the fix also works for you @QDucasse ?This solved the issue!