question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Transformation FoldConstants() raises ONNXRuntimeError

See original GitHub issue

Using 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:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
maltanarcommented, May 13, 2020

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 and master to address this. Can you confirm that the fix also works for you @QDucasse ?

0reactions
QDucassecommented, May 14, 2020

This solved the issue!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found